Skip to content

Commit adab21e

Browse files
authored
Merge pull request #6 from sitespeedio/dockerfile-cleanup
Tighten Dockerfile: pinning, certs, GPG hygiene
2 parents 0f4de3e + ea37051 commit adab21e

2 files changed

Lines changed: 30 additions & 10 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Build the docker container
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
jobs:
8+
build:
9+
name: Build
10+
runs-on: ubuntu-24.04
11+
if: ${{ !contains(github.event.head_commit.message, 'docs:') }}
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
15+
16+
- name: Build an image from Dockerfile
17+
run: |
18+
docker buildx install
19+
docker buildx build --load --platform linux/amd64 -t docker.io/sitespeedio/node:${{ github.sha }} .

‎Dockerfile‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
FROM ubuntu:noble-20260210.1
1+
FROM ubuntu:noble-20260410
22

33
ARG TARGETPLATFORM
44

55
# Dockerfile originally based on https://github.com/nodejs/docker-node/blob/master/6.11/slim/Dockerfile
66
# gpg keys listed at https://github.com/nodejs/node#release-team
77

88
ENV NPM_CONFIG_LOGLEVEL=info
9-
ENV NODE_VERSION=24.14.0
9+
ENV NODE_VERSION=24.15.0
1010

1111
RUN export PLATFORM=$(if [ "$TARGETPLATFORM" = "linux/amd64" ] ; then echo "x64"; else echo "arm64"; fi) \
12-
buildDeps='xz-utils curl ca-certificates gnupg2 lsb-release dirmngr' \
12+
&& buildDeps='xz-utils curl gnupg2 lsb-release dirmngr' \
1313
&& set -x \
14-
&& apt-get update && apt-get upgrade -y && apt-get install -y $buildDeps --no-install-recommends \
14+
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates $buildDeps \
1515
&& rm -rf /var/lib/apt/lists/* \
1616
# gpg keys listed at https://github.com/nodejs/node#release-keys
1717
&& set -ex \
18+
&& export GNUPGHOME="$(mktemp -d)" \
1819
&& for key in \
19-
4ED778F539E3634C779C87C6D7062848A1AB005C \
20-
141F07595B7B3FFE74309A937405533BE57C7D57 \
21-
74F12602B6F1C4E913FAA37AD3A89613643B6201 \
22-
61FC681DFB92A079F1685E77973F295594EC4689 \
20+
5BE8A3F6C8A5C01D106C0AD820B1A390B168D356 \
21+
DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 \
22+
CC68F5A3106FF448322E48ED27F5E38D5B0A215F \
2323
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
24-
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
2524
890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \
2625
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
2726
108F52B48DB57BB0CC439B2997B01419BD92F80A \
28-
CC68F5A3106FF448322E48ED27F5E38D5B0A215F \
27+
A363A499291CBBC940DD62E41F10027AF002F8B0 \
2928
; do \
3029
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
3130
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
@@ -36,6 +35,8 @@ RUN export PLATFORM=$(if [ "$TARGETPLATFORM" = "linux/amd64" ] ; then echo "x64"
3635
&& grep " node-v$NODE_VERSION-linux-$PLATFORM.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
3736
&& tar -xJf "node-v$NODE_VERSION-linux-$PLATFORM.tar.xz" -C /usr/local --strip-components=1 \
3837
&& rm "node-v$NODE_VERSION-linux-$PLATFORM.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
38+
&& { gpgconf --kill all || true; } \
39+
&& rm -rf "$GNUPGHOME" \
3940
&& apt-get purge -y --auto-remove $buildDeps \
4041
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
4142

0 commit comments

Comments
 (0)