Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions 20/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM debian:trixie-slim

ENV NPM_CONFIG_LOGLEVEL=info
ENV NODE_VERSION=20.19.4

# gpg keys listed at https://github.com/nodejs/node
RUN set -ex \
&& apt-get update \
&& apt-get install -y ca-certificates curl gnupg dirmngr xz-utils --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
# use pre-existing gpg directory, see https://github.com/nodejs/docker-node/pull/1895#issuecomment-1550389150
&& export GNUPGHOME="$(mktemp -d)" \
&& for key in \
5BE8A3F6C8A5C01D106C0AD820B1A390B168D356 \
DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 \
CC68F5A3106FF448322E48ED27F5E38D5B0A215F \
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
108F52B48DB57BB0CC439B2997B01419BD92F80A \
A363A499291CBBC940DD62E41F10027AF002F8B0 \
; do \
{ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" && gpg --batch --fingerprint "$key"; } || \
{ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" && gpg --batch --fingerprint "$key"; } ; \
done \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
&& gpgconf --kill all \
&& rm -rf "$GNUPGHOME" \
&& grep " node-v$NODE_VERSION-linux-x64.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-x64.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
&& node --version \
&& npm --version

CMD [ "node" ]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ bundle exec rake

The above will run Serverspec and using the docker-api gem it will

- Build a Docker image from the Docker file found in the top level directories (22)
- Build a Docker image from the Docker file found in the top level directories (20 and 22)
- Create a container of that image,
- Run the tests found in `spec/` on the container
- Delete the images and containers if the test was successful
Expand Down
23 changes: 23 additions & 0 deletions spec/20/Dockerfile_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require 'serverspec'
require 'docker'
require 'node_tests'
require 'npm_tests'

tag = ENV['TARGET_HOST']

describe "#{tag}" do
include Helpers

before(:all) do
create_image(tag)
end

test_node("20.19.4")

test_npm

after(:all) do
delete_image
end

end