Skip to content

Commit 912834c

Browse files
committed
added slim build
1 parent 52303d9 commit 912834c

File tree

4 files changed

+61
-3
lines changed

4 files changed

+61
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ RUN apt-get update \
4646
&& wget https://bootstrap.pypa.io/get-pip.py \
4747
&& python get-pip.py \
4848
&& pip install awscli --upgrade \
49-
&& apt-get clean
49+
&& apt-get clean

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
# Supported tags and respective `Dockerfile` links
44

55
- [`1.6.0-8.9.2`, `latest` (*Dockerfile*)](https://github.com/SweetIQ/docker-elixir-node-aws/blob/master/Dockerfile)
6-
- [`1.6.0-8.9.2-alpine`, `alpine` (*alpine/Dockerfile*)](https://github.com/SweetIQ/docker-elixir-node-aws/blob/master/Dockerfile)
6+
- [`1.6.0-8.9.2-slim`, `slim` (*slim/Dockerfile*)](https://github.com/SweetIQ/docker-elixir-node-aws/blob/master/alpine/Dockerfile)
7+
- [`1.6.0-8.9.2-alpine`, `alpine` (*alpine/Dockerfile*)](https://github.com/SweetIQ/docker-elixir-node-aws/blob/master/alpine/Dockerfile)

alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ RUN apk add --no-cache python-dev wget && \
5454
RUN apk add --no-cache ca-certificates tzdata && \
5555
cp /usr/share/zoneinfo/UTC /etc/localtime && \
5656
echo "UTC" > /etc/timezone && \
57-
apk del tzdata
57+
apk del tzdata

slim/Dockerfile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
FROM elixir:1.6.0-slim
2+
3+
RUN groupadd --gid 1000 node \
4+
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
5+
6+
# install awscli
7+
RUN apt-get update \
8+
&& apt-get install -y --no-install-recommends python-dev curl \
9+
&& apt-get clean
10+
11+
# gpg keys listed at https://github.com/nodejs/node#release-team
12+
RUN set -ex \
13+
&& for key in \
14+
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
15+
FD3A5288F042B6850C66B31F09FE44734EB7990E \
16+
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
17+
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
18+
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
19+
B9AE9905FFD7803F25714661B63B535A4C206CA9 \
20+
56730D5401028683275BD23C23EFEFE93C4CFFFE \
21+
77984A986EBC2AA786BC0F66B01FBB92821C587A \
22+
; do \
23+
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
24+
gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
25+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
26+
done
27+
28+
ENV NODE_VERSION 9.4.0
29+
30+
RUN buildDeps='xz-utils' \
31+
&& ARCH= && dpkgArch="$(dpkg --print-architecture)" \
32+
&& case "${dpkgArch##*-}" in \
33+
amd64) ARCH='x64';; \
34+
ppc64el) ARCH='ppc64le';; \
35+
s390x) ARCH='s390x';; \
36+
arm64) ARCH='arm64';; \
37+
armhf) ARCH='armv7l';; \
38+
i386) ARCH='x86';; \
39+
*) echo "unsupported architecture"; exit 1 ;; \
40+
esac \
41+
&& set -x \
42+
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
43+
&& rm -rf /var/lib/apt/lists/* \
44+
&& curl -k -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
45+
&& curl -k -SLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
46+
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
47+
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
48+
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
49+
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
50+
&& apt-get purge -y --auto-remove $buildDeps \
51+
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
52+
53+
# install awscli
54+
RUN curl -k -O https://bootstrap.pypa.io/get-pip.py \
55+
&& python get-pip.py \
56+
&& pip install awscli --upgrade \
57+
&& apt-get remove -y curl

0 commit comments

Comments
 (0)