Skip to content

Commit 3c9364c

Browse files
committed
Migrate dev Dockerfile to use Python virtual environment.
1 parent 257c243 commit 3c9364c

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

dev/Dockerfile

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ RUN dnf -y install yum-utils epel-release.noarch && \
4141
nmap-ncat \
4242
openssh-clients \
4343
openssl-devel \
44-
python3-setuptools \
45-
python3-pip \
4644
python3-devel \
4745
python3-mod_wsgi \
4846
python3-m2crypto \
@@ -62,22 +60,20 @@ RUN curl https://rclone.org/install.sh | bash
6260
RUN git clone --depth 1 --branch "$TAG" https://github.com/rucio/rucio.git /tmp/rucio && rm -rf /tmp/rucio/.git
6361

6462
ENV RUCIOHOME=/opt/rucio
65-
RUN mkdir -p $RUCIOHOME && \
66-
mkdir -p $RUCIOHOME/etc/multi_vo/tst/etc && \
67-
mkdir -p $RUCIOHOME/etc/multi_vo/ts2/etc
63+
ENV RUCIO_VENV=/opt/rucio-venv
64+
RUN python3 -m venv --system-site-packages "$RUCIO_VENV" && \
65+
mkdir -p "$RUCIOHOME/etc/multi_vo/tst/etc" \
66+
"$RUCIOHOME/etc/multi_vo/ts2/etc" \
67+
"$RUCIOHOME/bin" \
68+
"$RUCIOHOME/etc" \
69+
"$RUCIOHOME/lib/rucio" \
70+
"$RUCIOHOME/tools"
6871
WORKDIR $RUCIOHOME
69-
RUN mkdir -p \
70-
bin \
71-
etc \
72-
lib/rucio \
73-
tools
7472

75-
RUN python3 -m pip install --no-cache --upgrade pip && \
76-
python3 -m pip install --no-cache --upgrade --ignore-installed setuptools wheel && \
77-
python3 -m pip install --no-cache --upgrade -r /tmp/rucio/requirements/requirements.dev.txt ; \
78-
ln -s $RUCIOHOME/lib/rucio /usr/local/lib/python3.9/site-packages/rucio
79-
80-
RUN python3 -m pip install --no-cache --upgrade fts3
73+
RUN "$RUCIO_VENV/bin/pip" install --no-cache --upgrade pip setuptools wheel && \
74+
"$RUCIO_VENV/bin/pip" install --no-cache --upgrade -r /tmp/rucio/requirements/requirements.dev.txt && \
75+
"$RUCIO_VENV/bin/pip" install --no-cache --upgrade fts3 && \
76+
ln -s "$RUCIOHOME/lib/rucio" "$RUCIO_VENV/lib/python3.9/site-packages/rucio"
8177

8278
COPY .pep8 .pep8
8379
COPY .flake8 .flake8
@@ -127,7 +123,7 @@ RUN rm -r /tmp/rucio && \
127123
RUN update-crypto-policies --set DEFAULT:SHA1
128124

129125
EXPOSE 443
130-
ENV PATH $PATH:$RUCIOHOME/bin
126+
ENV PATH=$RUCIO_VENV/bin:$RUCIOHOME/bin:$PATH
131127
RUN mkdir /tmp/prometheus && chown apache:apache /tmp/prometheus/
132-
ENV PROMETHEUS_MULTIPROC_DIR /tmp/prometheus
128+
ENV PROMETHEUS_MULTIPROC_DIR=/tmp/prometheus
133129
CMD ["httpd","-D","FOREGROUND"]

0 commit comments

Comments
 (0)