Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

Commit

Permalink
v13.9.0 full and slim builds
Browse files Browse the repository at this point in the history
Includes ugly hack to work around nodejs/node#31858
  • Loading branch information
mhart committed Feb 19, 2020
1 parent 76072fc commit 9564f79
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 34 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Minimal Node.js Docker Images
-----------------------------

Versions v13.8.0, v12.16.1, v10.19.0, v8.17.0, v6.17.1, v4.9.1, v0.12.18 and v0.10.48 –
Versions v13.9.0, v12.16.1, v10.19.0, v8.17.0, v6.17.1, v4.9.1, v0.12.18 and v0.10.48 –
built on [Alpine Linux](https://alpinelinux.org/).

All versions use the one [mhart/alpine-node](https://hub.docker.com/r/mhart/alpine-node/) repository,
but each version aligns with the following tags (ie, `mhart/alpine-node:<tag>`). The sizes are for the
*unpacked* images as reported by Docker – compressed sizes are about 1/3 of these:

- Full install built with npm and yarn:
- `latest`, `13`, `13.8`, `13.8.0`107 MB (npm 6.13.7, yarn 1.22.0)
- `latest`, `13`, `13.9`, `13.9.0`106 MB (npm 6.13.7, yarn 1.22.0)
- `12`, `12.16`, `12.16.1` – 80.1 MB (npm 6.13.7, yarn 1.22.0)
- `10`, `10.19`, `10.19.0` – 74.9 MB (npm 6.13.7, yarn 1.22.0)
- `8`, `8.17`, `8.17.0` – 68.1 MB (npm 6.13.7, yarn 1.22.0)
Expand All @@ -19,7 +19,7 @@ but each version aligns with the following tags (ie, `mhart/alpine-node:<tag>`).
- `0.12`, `0.12.18` – 32.4 MB (npm 2.15.12)
- `0.10`, `0.10.48` – 27.8 MB (npm 2.15.12)
- Slim install with no npm or yarn:
- `slim`, `slim-13`, `slim-13.8`, `slim-13.8.0` – 71 MB
- `slim`, `slim-13`, `slim-13.9`, `slim-13.9.0` – 71.2 MB
- `slim-12`, `slim-12.16`, `slim-12.16.1` – 45.8 MB
- `slim-10`, `slim-10.19`, `slim-10.19.0` – 41.9 MB
- `slim-8`, `slim-8.17`, `slim-8.17.0` – 37.2 MB
Expand Down
7 changes: 4 additions & 3 deletions build-slim.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#/bin/sh

docker build --squash \
-t mhart/alpine-node:slim-12.16.1 \
-t mhart/alpine-node:slim-12.16 \
-t mhart/alpine-node:slim-12 \
-t mhart/alpine-node:slim-13.9.0 \
-t mhart/alpine-node:slim-13.9 \
-t mhart/alpine-node:slim-13 \
-t mhart/alpine-node:slim \
-f slim.dockerfile .
7 changes: 4 additions & 3 deletions build-tools.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#/bin/sh

docker build --squash \
-t mhart/alpine-node:12.16.1 \
-t mhart/alpine-node:12.16 \
-t mhart/alpine-node:12 \
-t mhart/alpine-node:13.9.0 \
-t mhart/alpine-node:13.9 \
-t mhart/alpine-node:13 \
-t mhart/alpine-node:latest \
-f tools.dockerfile .
20 changes: 12 additions & 8 deletions build.dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# FROM alpine:3.6
# FROM alpine:3.7
FROM alpine:3.9
# FROM alpine:3.10
# FROM alpine:3.9
FROM alpine:3.10

# ENV VERSION=v8.17.0 NPM_VERSION=6 YARN_VERSION=latest
# ENV VERSION=v10.19.0 NPM_VERSION=6 YARN_VERSION=latest
ENV VERSION=v12.16.1 NPM_VERSION=6 YARN_VERSION=latest
# ENV VERSION=v13.8.0 NPM_VERSION=6 YARN_VERSION=latest
# ENV VERSION=v12.16.1 NPM_VERSION=6 YARN_VERSION=latest
ENV VERSION=v13.9.0 NPM_VERSION=6 YARN_VERSION=latest

# For base builds
# ENV CONFIG_FLAGS="--fully-static --without-npm" DEL_PKGS="libstdc++" RM_DIRS=/usr/include
Expand All @@ -29,10 +29,14 @@ RUN for server in ipv4.pool.sks-keyservers.net keyserver.pgp.com ha.pool.sks-key
A48C2BEE680E841632CD4E44F07496B3EB3C1762 && break; \
done

RUN curl -sfSLO https://nodejs.org/dist/${VERSION}/node-${VERSION}.tar.xz && \
curl -sfSL https://nodejs.org/dist/${VERSION}/SHASUMS256.txt.asc | gpg -d -o SHASUMS256.txt && \
grep " node-${VERSION}.tar.xz\$" SHASUMS256.txt | sha256sum -c | grep ': OK$' && \
tar -xf node-${VERSION}.tar.xz && \
# RUN curl -sfSLO https://nodejs.org/dist/${VERSION}/node-${VERSION}.tar.xz && \
# curl -sfSL https://nodejs.org/dist/${VERSION}/SHASUMS256.txt.asc | gpg -d -o SHASUMS256.txt && \
# grep " node-${VERSION}.tar.xz\$" SHASUMS256.txt | sha256sum -c | grep ': OK$' && \
# tar -xf node-${VERSION}.tar.xz && \

# XXX: The above does not work for v13.9.0 due to https://github.com/nodejs/node/issues/31858
# Revert this for the next release
RUN git clone --depth 1 https://github.com/nodejs/node -b v13.9.0 node-${VERSION} && \
cd node-${VERSION} && \
./configure --prefix=/usr ${CONFIG_FLAGS} && \
make -j$(getconf _NPROCESSORS_ONLN) && \
Expand Down
9 changes: 5 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#/bin/sh

docker build --pull --squash \
-t mhart/alpine-node:12.16.1 \
-t mhart/alpine-node:12.16 \
-t mhart/alpine-node:12 \
-f extract.dockerfile \
-t mhart/alpine-node:13.9.0 \
-t mhart/alpine-node:13.9 \
-t mhart/alpine-node:13 \
-t mhart/alpine-node:latest \
-f build.dockerfile \
.
8 changes: 4 additions & 4 deletions extract.dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM alpine:3.9
# FROM alpine:3.10
# FROM alpine:3.9
FROM alpine:3.10

ENV VERSION=v12.16.1 NPM_VERSION=6 YARN_VERSION=latest
# ENV VERSION=v13.8.0 NPM_VERSION=6 YARN_VERSION=latest
# ENV VERSION=v12.16.1 NPM_VERSION=6 YARN_VERSION=latest
ENV VERSION=v13.9.0 NPM_VERSION=6 YARN_VERSION=latest

RUN apk upgrade --no-cache -U && \
apk add --no-cache curl gnupg libstdc++
Expand Down
2 changes: 1 addition & 1 deletion publish.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#/bin/sh

for tag in 12.16.1 12.16 12 slim-12.16.1 slim-12.16 slim-12; do
for tag in 13.9.0 13.9 13 slim-13.9.0 slim-13.9 slim-13 latest slim; do
git tag -f $tag
git push -f origin $tag
docker push mhart/alpine-node:$tag
Expand Down
8 changes: 4 additions & 4 deletions slim.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
# FROM mhart/alpine-node:10
# FROM alpine:3.7

FROM mhart/alpine-node:12
FROM alpine:3.9
# FROM mhart/alpine-node:12
# FROM alpine:3.9

# FROM mhart/alpine-node:13
# FROM alpine:3.10
FROM mhart/alpine-node:13
FROM alpine:3.10

COPY --from=0 /usr/bin/node /usr/bin/

Expand Down
8 changes: 4 additions & 4 deletions tools.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
# FROM mhart/alpine-node:10
# FROM alpine:3.7

FROM mhart/alpine-node:12
FROM alpine:3.9
# FROM mhart/alpine-node:12
# FROM alpine:3.9

# FROM mhart/alpine-node:13
# FROM alpine:3.10
FROM mhart/alpine-node:13
FROM alpine:3.10

COPY --from=0 /usr/bin/node /usr/bin/
COPY --from=0 /usr/lib/node_modules /usr/lib/node_modules
Expand Down

0 comments on commit 9564f79

Please sign in to comment.