File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ We build the base image using the Dockerfile, which validates the python requirements scaffolding that it copies from this directory.
2+
3+ To update the requirements (` Pipfile ` and ` Pipfile.lock ` ) build and execute the image generated by ` pipfile.Dockerfile ` like so:
4+
5+ 1 . docker build -f ./pipfile.Dockerfile -t pipfile-generator .
6+ 2 . docker run --rm -it -v .:/tmp/pip-airlock: Z pipfile-generator
7+ 3 . Commit the newly-generated ` Pipfile.lock ` file (NB: this directory is in root .gitignore file, so you must ` git add -f ` )
8+
Original file line number Diff line number Diff line change 1+ FROM registry.access.redhat.com/ubi8/ubi:8.9-1107 AS basebuilder
2+
3+ # Install Rust so that we can ensure backwards compatibility with installing/building the cryptography wheel across all platforms
4+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
5+ ENV PATH="/root/.cargo/bin:${PATH}"
6+ RUN rustc --version
7+
8+ # Copy python dependencies (including ansible) to be installed using Pipenv
9+ COPY ./Pipfile ./
10+ # Instruct pip(env) not to keep a cache of installed packages,
11+ # to install into the global site-packages and
12+ # to clear the pipenv cache as well
13+ ENV PIP_NO_CACHE_DIR=1 \
14+ PIPENV_SYSTEM=1 \
15+ PIPENV_CLEAR=1
16+ # Ensure fresh metadata rather than cached metadata, install system and pip python deps,
17+ # and remove those not needed at runtime.
18+ RUN set -e && yum clean all && rm -rf /var/cache/yum/* \
19+ && yum update -y \
20+ && yum install -y libffi-devel openssl-devel python39-devel gcc python39-pip python39-setuptools \
21+ && pip3 install --upgrade pip~=23.3.2 \
22+ && pip3 install pipenv==2023.11.15 \
23+ && pipenv lock \
24+ && pipenv check \
25+ && yum remove -y gcc libffi-devel openssl-devel python39-devel \
26+ && yum clean all \
27+ && rm -rf /var/cache/yum
28+
29+ VOLUME /tmp/pip-airlock
30+ ENTRYPOINT ["cp" , "./Pipfile.lock" , "/tmp/pip-airlock/" ]
31+ # to pull the generated lockfile, run this like
32+ # docker run --rm -it -v .:/tmp/pip-airlock:Z <image>
You can’t perform that action at this time.
0 commit comments