Skip to content

Commit

Permalink
Fix Dockerfile conda install error for some shells (pytorch#92702)
Browse files Browse the repository at this point in the history
The issue was first solved in [pytorch/pull/91371] for CI/CD, but the main Dockerfile in the repo root still has this issue for people trying to test build custom image manually.
Without it the build fails at installing miniconda
```
#14 3.802 Preparing transaction: ...working... done
#14 4.087 Executing transaction: ...working... done
#14 5.713 /root/miniconda.sh: 438: /root/miniconda.sh: [[: not found
#14 5.713
#14 5.713 Installing * environment...
#14 5.713
#14 5.714 /root/miniconda.sh: 444: /root/miniconda.sh: [[: not found
#14 6.050
#14 6.050 CondaFileIOError: '/opt/conda/pkgs/envs/*/env.txt'. [Errno 2] No such
file or directory: '/opt/conda/pkgs/envs/*/env.txt'
#14 6.050
```

With the modification, locally tested build successfully with `make -f ./docker.Makefile` as instructed in the README

Pull Request resolved: pytorch#92702
Approved by: https://github.com/seemethere, https://github.com/malfet
  • Loading branch information
VRShard authored and pytorchmergebot committed Jan 24, 2023
1 parent b0f5e15 commit bf1ff49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ RUN case ${TARGETPLATFORM} in \
esac && \
curl -fsSL -v -o ~/miniconda.sh -O "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-${MINICONDA_ARCH}.sh"
COPY requirements.txt .
# Manually invoke bash on miniconda script per https://github.com/conda/conda/issues/10431
RUN chmod +x ~/miniconda.sh && \
~/miniconda.sh -b -p /opt/conda && \
bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda install -y python=${PYTHON_VERSION} cmake conda-build pyyaml numpy ipython && \
/opt/conda/bin/python -mpip install -r requirements.txt && \
Expand Down

0 comments on commit bf1ff49

Please sign in to comment.