forked from tarampampam/node-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (22 loc) · 901 Bytes
/
Copy pathDockerfile
File metadata and controls
25 lines (22 loc) · 901 Bytes
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
# syntax=docker/dockerfile:1.2
# e.g.: `docker build --rm --build-arg "NODE_VERSION=latest" -f ./Dockerfile .`
# e.g.: `docker build --rm --build-arg "NODE_VERSION=11.8-alpine" -f ./Dockerfile .`
ARG NODE_VERSION
FROM node:${NODE_VERSION:-alpine}
RUN set -x \
&& . /etc/os-release \
&& case "$ID" in \
alpine) \
apk add --no-cache bash git openssh \
;; \
debian) \
apt-get update \
&& apt-get -yq install bash git openssh-server \
&& apt-get -yq clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
;; \
esac \
# install yarn, if needed (only applies to older versions, like 6 or 7)
&& yarn bin || ( npm install --global yarn && npm cache clean ) \
# show installed application versions
&& git --version && bash --version && ssh -V && npm -v && node -v && yarn -v