Last active
November 12, 2019 04:33
-
-
Save theeluwin/331f6304d11d1b2e1748b7c457290955 to your computer and use it in GitHub Desktop.
파이토치 런타임 환경용 도커
This file contains hidden or 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
# syntax=docker/dockerfile:experimental | |
# from | |
FROM pytorch/pytorch:1.2-cuda10.0-cudnn7-runtime | |
LABEL maintainer="Jamie Seol <[email protected]>" | |
# apt init | |
ENV PYTHONUNBUFFERED=1 | |
ENV LANG=C.UTF-8 | |
ENV TZ=Asia/Seoul | |
ENV DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends tzdata | |
# apt cleanse | |
RUN apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* | |
# timezone | |
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
# settle workspace | |
RUN mkdir -p /workspace | |
WORKDIR /workspace | |
# install python packages | |
COPY requirements.txt /workspace/ | |
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt | |
# torch cache | |
RUN mkdir -p /root/.cache/torch/checkpoints/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DOCKER_BUILDKIT=1 docker build -t jamie-sandbox -f Dockerfile .
docker run --rm -it --init --gpus=all --volume="$HOME/.cache/torch:/root/.cache/torch" --volume="$PWD:/workspace" -e NVIDIA_VISIBLE_DEVICES=1 jamie-sandbox python entry.py