-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
68 lines (51 loc) · 1.82 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
FROM ubuntu:20.04
ARG NODE_MAJOR_VERSION=14
ARG NPM_GLOBAL_MODULES
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# We do not need exact versions, each user will have their own version of the environment
# hadolint ignore=DL3008
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qq update \
&& apt-get -qq install \
--no-install-recommends \
apt-transport-https \
build-essential \
ca-certificates \
curl \
git \
gnupg-agent \
lsb-release \
openssh-server \
software-properties-common \
wget \
xz-utils \
&& apt-get -qq clean \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s python3 /usr/bin/python
# Install npm nodejs and yarn
# We do not need exact versions, each user will have their own version of the environment
# hadolint ignore=DL3008
RUN export DEBIAN_FRONTEND=noninteractive \
&& export APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 \
&& curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
&& version=node_${NODE_MAJOR_VERSION}.x \
&& distro="$(lsb_release -cs)" \
&& add-apt-repository -s "deb https://deb.nodesource.com/$version $distro main" \
&& apt-get -qq update \
&& apt-get -qq install \
--no-install-recommends \
nodejs \
&& apt-get -qq clean \
&& rm -rf /var/lib/apt/lists/*
# Set a global installation folder that requires no elevation
RUN mkdir /npm-global \
&& npm config set prefix "/npm-global"
# Node global tools
# We do not need exact versions, each user will have their own version of the environment
# hadolint ignore=DL3016
RUN npm install -g npm yarn ${NPM_GLOBAL_MODULES}
# Need to change permissions of /npm-global submodules
RUN chmod -R +777 /npm-global
# Add entrypoint file that will perform run-time configuration before being deployed
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]