Re:PyTorch 2.0 Release
by mardifoufs on Wednesday March 15, 2023 @09:28PM
(#35177028)
That's basically where we are at for tons of our pipelines, but it kind of defeats the purpose since a dockerfile with a proper base image is basically equivalent at that point.
[ Parent
| on HN ]
Re:PyTorch 2.0 Release
by disgruntledphd2 on Thursday March 16, 2023 @05:53AM
(#35179985)
Conda is also really annoying to get working in a Dockerfile, because (if I remember correctly) of differences between login and non-login shells.
In general you shouldn't need to "activate" a Conda environment in the shell. Things generally "just work" if you use absolute paths. Something like this:
COPY conda.yaml /env/conda.yaml
RUN conda env create -f /env/conda.yaml -p /env/conda
COPY foo.py /env/foo.py
CMD ["/env/conda/bin/python", "/env/foo.py"]
What is a little funny is installing a consistent version of Conda inside a container, because the official Miniconda installers are rolling-release only. However you might be able to downgrade to your desired version of Conda after installation.