-
Notifications
You must be signed in to change notification settings - Fork 343
/
Copy pathDockerfile
104 lines (91 loc) · 2.88 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
ARG BASE_IMAGE=ubuntu:20.04
FROM ${BASE_IMAGE}
LABEL maintainer="CML <[email protected]>"
# CONFIGURE NON-INTERACTIVE APT
ENV DEBIAN_FRONTEND=noninteractive
RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90assumeyes
# CONFIGURE SHELL
SHELL ["/bin/bash", "-c"]
# INSTALL CORE DEPENDENCIES
RUN apt-get update \
&& apt-get install --no-install-recommends \
build-essential \
apt-utils \
apt-transport-https \
ca-certificates \
iputils-ping \
software-properties-common \
pkg-config \
curl \
wget \
unzip \
gpg-agent \
sudo \
tzdata \
locales \
&& locale-gen en_US.UTF-8 \
&& apt-get clean \
&& rm --recursive --force /var/lib/apt/lists/*
# CONFIGURE LOCALE
ENV LANG="en_US.UTF-8"
ENV LANGUAGE="en_US:en"
ENV LC_ALL="en_US.UTF-8"
# INSTALL NODE, GIT & GO
RUN add-apt-repository ppa:git-core/ppa --yes \
&& add-apt-repository ppa:longsleep/golang-backports --yes \
&& curl --location https://deb.nodesource.com/setup_12.x | bash \
&& apt-get update \
&& apt-get install --yes git golang-go nodejs \
&& apt-get clean \
&& rm --recursive --force /var/lib/apt/lists/*
# INSTALL TERRAFORM
RUN curl --location https://apt.releases.hashicorp.com/gpg | sudo apt-key add - \
&& apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release --codename --short) main" \
&& apt update \
&& apt-get install --yes terraform \
&& apt-get clean \
&& rm --recursive --force /var/lib/apt/lists/*
# INSTALL PYTHON
ARG PYTHON_VERSION=3
RUN add-apt-repository universe --yes \
&& apt-get update \
&& PYTHON_SUFFIX="$(sed --expression='s/3.*/3/g' --expression='s/2.*//g' <<< "${PYTHON_VERSION}")" \
&& apt-get install --yes --no-install-recommends python${PYTHON_VERSION} python${PYTHON_SUFFIX}{-pip,-setuptools,-dev} \
&& update-alternatives --install /usr/bin/python python${PYTHON_VERSION} $(which python${PYTHON_VERSION}) 10 \
&& python -m pip install pip --upgrade \
&& apt-get clean \
&& rm --recursive --force /var/lib/apt/lists/*
# INSTALL DVC
ARG DVC_VERSION=2
RUN cd /etc/apt/sources.list.d \
&& wget https://dvc.org/deb/dvc.list \
&& apt-get update \
&& apt-get install --yes "dvc=${DVC_VERSION}.*" \
&& apt-get clean \
&& rm --recursive --force /var/lib/apt/lists/*
# INSTALL CML
ARG CML_VERSION=0
RUN npm config set user 0 \
&& npm install --global "@dvcorg/cml@${CML_VERSION}"
# INSTALL VEGA
RUN add-apt-repository universe --yes \
&& apt-get update \
&& apt-get install --yes \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
libfontconfig-dev \
&& apt-get clean \
&& rm --recursive --force /var/lib/apt/lists/* \
&& npm config set user 0 \
&& npm install --global canvas vega vega-cli vega-lite
# CONFIGURE RUNNER PATH
ENV RUNNER_PATH=/home/runner
ENV RUNNER_ALLOW_RUNASROOT=1
RUN mkdir ${RUNNER_PATH}
WORKDIR ${RUNNER_PATH}
# COMMAND
ENV IN_DOCKER=1
CMD ["cml-runner"]