-
Notifications
You must be signed in to change notification settings - Fork 270
/
Copy pathDockerfile
53 lines (41 loc) · 1.69 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
# run instructions:
# build image: docker build -t kengz/slm_lab:latest -t kengz/slm_lab:v4.2.0 .
# start container: docker run --rm -it kengz/slm_lab:v4.2.0
# list image: docker images -a
# push image: docker push kengz/slm_lab
# prune: docker system prune
FROM ubuntu:16.04
LABEL maintainer="[email protected]"
LABEL website="https://github.com/kengz/SLM-Lab"
SHELL ["/bin/bash", "-c"]
RUN apt-get update && \
apt-get install -y build-essential \
curl nano git wget zip libstdc++6 \
python3-dev zlib1g-dev libjpeg-dev cmake swig python-pyglet python3-opengl libboost-all-dev libsdl2-dev libosmesa6-dev patchelf ffmpeg xvfb && \
rm -rf /var/lib/apt/lists/*
RUN curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
bash Miniconda3-latest-Linux-x86_64.sh -b && \
rm Miniconda3-latest-Linux-x86_64.sh && \
echo '. ~/miniconda3/etc/profile.d/conda.sh' >> ~/.bashrc && \
. ~/miniconda3/etc/profile.d/conda.sh && \
conda --version
# create and set the working directory
RUN mkdir -p /root/SLM-Lab
WORKDIR /root/SLM-Lab
# install dependencies, only retrigger on dependency changes
COPY environment.yml environment.yml
# install Python and Conda dependencies
RUN . ~/miniconda3/etc/profile.d/conda.sh && \
conda create -n lab python=3.7.3 -y && \
conda activate lab && \
conda env update -f environment.yml && \
conda clean -y --all && \
rm -rf ~/.cache/pip
# copy file at last to not trigger changes above unnecessarily
COPY . .
RUN . ~/miniconda3/etc/profile.d/conda.sh && \
conda activate lab && \
python setup.py test
# pytest --verbose --no-flaky-report test/spec/test_dist_spec.py && \
# yarn reset
CMD ["/bin/bash"]