Last active
June 25, 2023 10:51
-
-
Save jungin500/11a1001b9153dc30fc40548fbcecbf01 to your computer and use it in GitHub Desktop.
Dockerfile of `gcr.io/kubeflow-ci/pytorch-dist-mnist_test:1.0` generated with `dfimage`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUN set -xe \ | |
&& echo '#!/bin/sh' > /usr/sbin/policy-rc.d \ | |
&& echo 'exit 101' >> /usr/sbin/policy-rc.d \ | |
&& chmod +x /usr/sbin/policy-rc.d \ | |
&& dpkg-divert --local --rename --add /sbin/initctl \ | |
&& cp -a /usr/sbin/policy-rc.d /sbin/initctl \ | |
&& sed -i 's/^exit.*/exit 0/' /sbin/initctl \ | |
&& echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup \ | |
&& echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' > /etc/apt/apt.conf.d/docker-clean \ | |
&& echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb var/cache/apt/*.bin || true"; };' >> /etc/apt/apt.conf.d/docker-clean \ | |
&& echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' >> /etc/apt/apt.conf.d/docker-clean \ | |
&& echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/docker-no-languages \ && echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > /etc/apt/apt.conf.d/docker-gzip-indexes \ | |
&& echo 'Apt::AutoRemove::SuggestsImportant "false";' > /etc/apt/apt.conf.d/docker-autoremove-suggests | |
RUN rm -rf /var/lib/apt/lists/* | |
RUN mkdir -p /run/systemd \ | |
&& echo 'docker' > /run/systemd/container | |
CMD ["/bin/bash"] | |
ARG cuda_version=cuda100 | |
LABEL com.nvidia.volumes.needed=nvidia_driver | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends build-essential git curl ca-certificates libjpeg-dev libpng-dev \ | |
&& rm -rf /var/lib/apt/lists/* | |
ENV PYTHON_VERSION=3.6 | |
RUN curl -v -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ | |
&& chmod +x ~/miniconda.sh \ | |
&& ~/miniconda.sh -b -p /opt/conda \ | |
&& rm ~/miniconda.sh \ | |
&& /opt/conda/bin/conda install -y python=$PYTHON_VERSION conda-build pyyaml numpy ipython \ | |
&& /opt/conda/bin/conda clean -ya | |
ENV PATH=/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
RUN conda install pytorch torchvision ${cuda_version} -c pytorch \ | |
&& /opt/conda/bin/conda clean -ya | |
ENV NVIDIA_VISIBLE_DEVICES=all | |
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility | |
ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64 | |
WORKDIR /workspace | |
RUN chmod -R a+w /workspace | |
RUN pip install tensorboardX==1.6.0 | |
WORKDIR /var | |
ADD var/mnist.py | |
ENTRYPOINT ["python" "/var/mnist.py"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment