Skip to content

Commit

Permalink
docker: set $HOME before sourcing profile
Browse files Browse the repository at this point in the history
This fixes $HOME pointing to /root, fixing the following error during
autoconf:

    /bin/sh: 31: .: cannot open /root/.cargo/env: No such file

An alternative here would be to use the USER Docker directive, but that
required making /judge-runtime-paths.yml writable by the judge user.
This is simpler.
  • Loading branch information
Xyene committed Jun 28, 2021
1 parent b7fb130 commit 1fb0750
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .docker/tier1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG TAG=master
RUN mkdir /judge /problems && cd /judge && \
curl -L https://github.com/DMOJ/judge-server/archive/"${TAG}".tar.gz | tar -xz --strip-components=1 && \
pip3 install -e . && \
. ~judge/.profile && \
HOME=~judge . ~judge/.profile && \
runuser -u judge -w PATH -- dmoj-autoconf -V > /judge-runtime-paths.yml && \
echo ' crt_x86_in_lib32: true' >> /judge-runtime-paths.yml

Expand Down
3 changes: 1 addition & 2 deletions .docker/tier2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ ARG TAG=master
RUN mkdir /judge /problems && cd /judge && \
curl -L https://github.com/DMOJ/judge-server/archive/"${TAG}".tar.gz | tar -xz --strip-components=1 && \
pip3 install -e . && \
sed -i 's/source "$HOME/. "\/home\/judge/' ~judge/.profile && \
. ~judge/.profile && \
HOME=~judge . ~judge/.profile && \
runuser -u judge -w PATH -- dmoj-autoconf -V > /judge-runtime-paths.yml && \
echo ' crt_x86_in_lib32: true' >> /judge-runtime-paths.yml

Expand Down
3 changes: 1 addition & 2 deletions .docker/tier3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ ARG TAG=master
RUN mkdir /judge /problems && cd /judge && \
curl -L https://github.com/DMOJ/judge-server/archive/"${TAG}".tar.gz | tar -xz --strip-components=1 && \
pip3 install -e . && \
sed -i 's/source "$HOME/. "\/home\/judge/' ~judge/.profile && \
. ~judge/.profile && \
HOME=~judge . ~judge/.profile && \
runuser -u judge -w PATH -- dmoj-autoconf -V > /judge-runtime-paths.yml && \
echo ' crt_x86_in_lib32: true' >> /judge-runtime-paths.yml

Expand Down

0 comments on commit 1fb0750

Please sign in to comment.