Skip to content

Commit 1e3b24b

Browse files
committed
Install specific versions of pip and pip-tools for compatibility
1 parent ee0550b commit 1e3b24b

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

anms.Containerfile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,34 @@ ENV APP_USER=anms
3939
RUN groupadd -r -g 9999 ${APP_USER} && \
4040
useradd -m -r -g ${APP_USER} -u 9999 ${APP_USER}
4141

42+
4243
# This image includes common libraries used by the aricodec and anms-core
4344
# containers.
4445
# Sets environment:
4546
# PY_WHEEL_DIR to local PIP wheel search path
4647
#
4748
FROM anms-base AS dtnma-acelib
4849

49-
5050
# Install System Level Dependencies
5151
RUN --mount=type=cache,target=/var/cache/yum \
52-
dnf -y install gcc-c++ python-devel python3-pip python3-wheel python3-setuptools iputils && \
53-
pip3 install pip-tools
52+
dnf -y install gcc-c++ python-devel python3-pip python3-wheel python3-setuptools iputils
5453

5554
# Use specific OS python version
5655
ENV PIP=pip3
5756
ENV PYTHON=python3
5857
# Submodules with dependencies
5958
ENV PY_WHEEL_DIR=/usr/local/lib/wheels
6059

61-
RUN ${PIP} install --upgrade pip
60+
RUN --mount=type=cache,target=/root/.cache/pip \
61+
${PIP} install --upgrade 'pip~=24.0' 'pip-tools~=7.5'
6262

6363
COPY deps/dtnma-ace /usr/src/dtnma-ace
64-
RUN ${PIP} -v wheel /usr/src/dtnma-ace -w ${PY_WHEEL_DIR} --no-deps
64+
RUN --mount=type=cache,target=/root/.cache/pip \
65+
${PIP} wheel /usr/src/dtnma-ace -w ${PY_WHEEL_DIR} --no-deps
6566

6667
COPY deps/dtnma-camp /usr/src/dtnma-camp
67-
RUN ${PIP} wheel /usr/src/dtnma-camp -w ${PY_WHEEL_DIR} --no-deps
68+
RUN --mount=type=cache,target=/root/.cache/pip \
69+
${PIP} wheel /usr/src/dtnma-camp -w ${PY_WHEEL_DIR} --no-deps
6870

6971
COPY deps/dtnma-adms /usr/src/dtnma-adms
7072

@@ -189,7 +191,8 @@ ENV APP_WORK_DIR=/opt/app
189191
# Copy over all required content (source, data, etc.)
190192
COPY --chown=${APP_USER}:${APP_USER} transcoder ${APP_WORK_DIR}
191193
# Install all python dependencies
192-
RUN ${PIP} install -r ${APP_WORK_DIR}/requirements.txt
194+
RUN --mount=type=cache,target=/root/.cache/pip \
195+
${PIP} install -r ${APP_WORK_DIR}/requirements.txt
193196

194197
# Tune Final Settings
195198
WORKDIR ${APP_WORK_DIR}
@@ -239,12 +242,14 @@ ENV APP_WORK_DIR=/usr/src/anms-core
239242

240243
# Requirement of main module
241244
COPY anms-core/pyproject.toml ${APP_WORK_DIR}/
242-
RUN cd ${APP_WORK_DIR} && \
245+
RUN --mount=type=cache,target=/root/.cache/pip \
246+
cd ${APP_WORK_DIR} && \
243247
pip-compile --find-links ${PY_WHEEL_DIR} pyproject.toml && \
244248
${PIP} install --ignore-installed -r requirements.txt
245249
# Actual main package
246250
COPY anms-core/anms ${APP_WORK_DIR}/anms
247-
RUN ${PIP} install ${APP_WORK_DIR}
251+
RUN --mount=type=cache,target=/root/.cache/pip \
252+
${PIP} install ${APP_WORK_DIR}
248253

249254
RUN mkdir -p /usr/local/share/ace && \
250255
cp -R /usr/src/dtnma-adms /usr/local/share/ace/adms

0 commit comments

Comments
 (0)