Skip to content

Commit

Permalink
Move SHELL to the last stage
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Zhao <simonyansenzhao@gmail.com>
  • Loading branch information
SimonYansenZhao committed Sep 20, 2024
1 parent 3f59bb3 commit d0c64f1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tools/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,10 @@ ARG PYTHON_VERSION="3.11"
ARG VIRTUAL_ENV="conda"

ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV DEBIAN_FRONTEND noninteractive

WORKDIR /root
USER root:root

# -i option used to source bashrc (thus activating conda env) at every RUN statement
SHELL ["/bin/bash", "-i", "-c"]

# Exit if VIRTUAL_ENV is not specified correctly
RUN if ! [[ "${VIRTUAL_ENV}" =~ ^(conda|venv|virtualenv)$ ]]; then \
echo "VIRTUAL_ENV is now '${VIRTUAL_ENV}', which should be either 'conda', 'venv' or 'virtualenv'"; \
Expand Down Expand Up @@ -164,6 +160,9 @@ FROM deps AS final
ARG RECO_LOCAL_DIR="./"
ARG RECO_DIR="/tmp/recommenders"

# -i option used to source bashrc (thus activating conda env) at every RUN statement
SHELL ["/bin/bash", "-i", "-c"]

COPY ${RECO_LOCAL_DIR} ${RECO_DIR}

RUN RECO=$(if [ -z "${GIT_REF}" ]; then echo "${RECO_DIR}"; else echo "recommenders"; fi); \
Expand Down

0 comments on commit d0c64f1

Please sign in to comment.