-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
60 lines (48 loc) · 1.78 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
# ref https://github.com/tebeka/pythonwise/blob/master/docker-miniconda/Dockerfile
#
# miniconda vers: http://repo.continuum.io/miniconda
# sample variations:
# Miniconda3-latest-Linux-armv7l.sh
# Miniconda3-latest-Linux-x86_64.sh
# Miniconda3-py38_4.10.3-Linux-x86_64.sh
# Miniconda3-py37_4.10.3-Linux-x86_64.sh
#
# py vers: https://anaconda.org/anaconda/python/files
# tf vers: https://anaconda.org/anaconda/tensorflow/files
# tf-mkl vers: https://anaconda.org/anaconda/tensorflow-mkl/files
#
ARG UBUNTU_VER=20.04
ARG CONDA_VER=latest
ARG OS_TYPE=x86_64
ARG PY_VER=3.8.11
FROM ubuntu:${UBUNTU_VER}
# System packages
RUN apt-get -y update
RUN apt-get -y upgrade
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
RUN apt-get install -yq curl build-essential
RUN apt-get install -y git
RUN apt-get install ffmpeg libsm6 libxext6 -y
# Use the above args during building https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
ARG CONDA_VER
ARG OS_TYPE
# Install miniconda to /miniconda
RUN curl -LO "http://repo.continuum.io/miniconda/Miniconda3-${CONDA_VER}-Linux-${OS_TYPE}.sh"
RUN bash Miniconda3-${CONDA_VER}-Linux-${OS_TYPE}.sh -p /miniconda -b
RUN rm Miniconda3-${CONDA_VER}-Linux-${OS_TYPE}.sh
ENV PATH=/miniconda/bin:${PATH}
RUN conda update -y conda
RUN conda install -c conda-forge jupyterlab
RUN conda install -c conda-forge nb_conda_kernels
ARG PY_VER
RUN mkdir /home/robot_pose_estimation
RUN mkdir /home/dataset
COPY environment.yml environment.yml
RUN conda env create -f environment.yml
SHELL ["conda","run","-n","pytorch","/bin/bash","-c"]
RUN python -m ipykernel install --name pytorch --display-name "pytorch"
SHELL ["/bin/bash","-c"]
RUN conda init
RUN echo 'conda activate pytorch' >> ~/.bashrc
WORKDIR /home