Skip to content

Commit

Permalink
feat: adds Node.js 20 support (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
timbru31 authored Nov 27, 2023
1 parent 8abc42c commit 2962262
Show file tree
Hide file tree
Showing 15 changed files with 300 additions and 6 deletions.
46 changes: 43 additions & 3 deletions .github/workflows/buildx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6

- path: 3.2/18
tags: "3.2 3.2-18 3.2-hydrogen latest"
tags: "3.2 3.2-18 3.2-hydrogen"
platforms: linux/amd64,linux/arm64,linux/arm/v7
- path: 3.2/18/slim
tags: "3.2-slim 3.2-slim-18 3.2-slim-hydrogen slim"
tags: "3.2-slim 3.2-slim-18 3.2-slim-hydrogen"
platforms: linux/amd64,linux/arm64,linux/arm/v7
- path: 3.2/18/alpine
tags: "3.2-alpine 3.2-alpine-18 3.2-alpine-hydrogen alpine"
tags: "3.2-alpine 3.2-alpine-18 3.2-alpine-hydrogen"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6

- path: 3.3/18
Expand All @@ -54,6 +54,46 @@ jobs:
- path: 3.3/18/alpine
tags: "3.3-alpine 3.3-alpine-18 3.3-alpine-hydrogen"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6

- path: 3.0/20
tags: "3.0 3.0-20 3.0-iron"
platforms: linux/amd64,linux/arm64,linux/arm/v7
- path: 3.0/20/slim
tags: "3.0-slim 3.0-slim-20 3.0-slim-iron"
platforms: linux/amd64,linux/arm64,linux/arm/v7
- path: 3.0/20/alpine
tags: "3.0-alpine 3.0-alpine-20 3.0-alpine-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6

- path: 3.1/20
tags: "3.1-20 3.1-iron"
platforms: linux/amd64,linux/arm64,linux/arm/v7
- path: 3.1/20/slim
tags: "3.1-slim-20 3.1-slim-iron"
platforms: linux/amd64,linux/arm64,linux/arm/v7
- path: 3.1/20/alpine
tags: "3.1-alpine-20 3.1-alpine-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6

- path: 3.2/20
tags: "3.2 3.2-20 3.2-iron latest"
platforms: linux/amd64,linux/arm64,linux/arm/v7
- path: 3.2/20/slim
tags: "3.2-slim 3.2-slim-20 3.2-slim-iron slim"
platforms: linux/amd64,linux/arm64,linux/arm/v7
- path: 3.2/20/alpine
tags: "3.2-alpine 3.2-alpine-20 3.2-alpine-iron alpine"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6

- path: 3.3/20
tags: "3.3 3.3-20 3.3-iron"
platforms: linux/amd64,linux/arm64,linux/arm/v7
- path: 3.3/20/slim
tags: "3.3-slim 3.3-slim-20 3.3-slim-iron"
platforms: linux/amd64,linux/arm64,linux/arm/v7
- path: 3.3/20/alpine
tags: "3.3-alpine 3.3-alpine-20 3.3-alpine-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,33 @@ jobs:
echo "3.3 alpine with Node.js 18"
docker run -i $(docker build -q 3.3/18/alpine) /bin/sh -c "ruby --version && node --version && npm --version"
echo "3.0 with Node.js 20"
docker run -i $(docker build -q 3.0/20) /bin/sh -c "ruby --version && node --version && npm --version"
echo "3.0 slim with Node.js 20"
docker run -i $(docker build -q 3.0/20/slim) /bin/sh -c "ruby --version && node --version && npm --version"
echo "3.0 alpine with Node.js 20"
docker run -i $(docker build -q 3.0/20/alpine) /bin/sh -c "ruby --version && node --version && npm --version"
echo "3.1 with Node.js 20"
docker run -i $(docker build -q 3.1/20) /bin/sh -c "ruby --version && node --version && npm --version"
echo "3.1 slim with Node.js 20"
docker run -i $(docker build -q 3.1/20/slim) /bin/sh -c "ruby --version && node --version && npm --version"
echo "3.1 alpine with Node.js 20"
docker run -i $(docker build -q 3.1/20/alpine) /bin/sh -c "ruby --version && node --version && npm --version"
echo "3.2 with Node.js 20"
docker run -i $(docker build -q 3.2/20) /bin/sh -c "ruby --version && node --version && npm --version"
echo "3.2 slim with Node.js 20"
docker run -i $(docker build -q 3.2/20/slim) /bin/sh -c "ruby --version && node --version && npm --version"
echo "3.2 alpine with Node.js 20"
docker run -i $(docker build -q 3.2/20/alpine) /bin/sh -c "ruby --version && node --version && npm --version"
echo "3.3 with Node.js 20"
docker run -i $(docker build -q 3.3/20) /bin/sh -c "ruby --version && node --version && npm --version"
echo "3.3 slim with Node.js 20"
docker run -i $(docker build -q 3.3/20/slim) /bin/sh -c "ruby --version && node --version && npm --version"
echo "3.3 alpine with Node.js 20"
docker run -i $(docker build -q 3.3/20/alpine) /bin/sh -c "ruby --version && node --version && npm --version"
auto-merge:
runs-on: ubuntu-latest
needs: build
Expand Down
18 changes: 18 additions & 0 deletions 3.0/20/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM ruby:3.0
LABEL maintainer "Tim Brust <github@timbrust.de>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT
ARG NODE_MAJOR=20

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -qq && apt-get install -qq --no-install-recommends \
nodejs \
&& apt-get upgrade -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g yarn@1
14 changes: 14 additions & 0 deletions 3.0/20/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ruby:3.0-alpine
LABEL maintainer "Tim Brust <github@timbrust.de>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT

RUN echo @edge https://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \
&& echo @edge https://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories \
&& apk -U upgrade \
&& apk add --no-cache \
libstdc++-dev@edge \
nodejs@edge \
npm@edge \
yarn
24 changes: 24 additions & 0 deletions 3.0/20/slim/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ruby:3.0-slim
LABEL maintainer "Tim Brust <github@timbrust.de>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT
ARG NODE_MAJOR=20

# hadolint ignore=DL3009
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
curl \
gnupg2 \
libatomic1

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -qq && apt-get install -qq --no-install-recommends \
nodejs \
&& apt-get upgrade -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g yarn@1
19 changes: 19 additions & 0 deletions 3.1/20/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ruby:3.1
LABEL maintainer "Tim Brust <github@timbrust.de>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT
ARG NODE_MAJOR=20

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN printf 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 1001' > /etc/apt/preferences.d/nodesource \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -qq && apt-get install -qq --no-install-recommends \
nodejs \
&& apt-get upgrade -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g yarn@1
13 changes: 13 additions & 0 deletions 3.1/20/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ruby:3.1-alpine
LABEL maintainer "Tim Brust <github@timbrust.de>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT

RUN echo @edge https://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \
&& echo @edge https://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories \
&& apk -U upgrade \
&& apk add --no-cache \
nodejs@edge \
npm@edge \
yarn
25 changes: 25 additions & 0 deletions 3.1/20/slim/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ruby:3.1-slim
LABEL maintainer "Tim Brust <github@timbrust.de>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT
ARG NODE_MAJOR=20

# hadolint ignore=DL3009
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
curl \
gnupg2 \
libatomic1

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN printf 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 1001' > /etc/apt/preferences.d/nodesource \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -qq && apt-get install -qq --no-install-recommends \
nodejs \
&& apt-get upgrade -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g yarn@1
19 changes: 19 additions & 0 deletions 3.2/20/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ruby:3.2
LABEL maintainer "Tim Brust <github@timbrust.de>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT
ARG NODE_MAJOR=20

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN printf 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 1001' > /etc/apt/preferences.d/nodesource \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -qq && apt-get install -qq --no-install-recommends \
nodejs \
&& apt-get upgrade -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g yarn@1
13 changes: 13 additions & 0 deletions 3.2/20/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ruby:3.2-alpine
LABEL maintainer "Tim Brust <github@timbrust.de>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT

RUN echo @edge https://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \
&& echo @edge https://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories \
&& apk -U upgrade \
&& apk add --no-cache \
nodejs@edge \
npm@edge \
yarn
25 changes: 25 additions & 0 deletions 3.2/20/slim/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ruby:3.2-slim
LABEL maintainer "Tim Brust <github@timbrust.de>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT
ARG NODE_MAJOR=20

# hadolint ignore=DL3009
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
curl \
gnupg2 \
libatomic1

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN printf 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 1001' > /etc/apt/preferences.d/nodesource \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -qq && apt-get install -qq --no-install-recommends \
nodejs \
&& apt-get upgrade -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g yarn@1
19 changes: 19 additions & 0 deletions 3.3/20/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ruby:3.3-rc
LABEL maintainer "Tim Brust <github@timbrust.de>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT
ARG NODE_MAJOR=20

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN printf 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 1001' > /etc/apt/preferences.d/nodesource \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -qq && apt-get install -qq --no-install-recommends \
nodejs \
&& apt-get upgrade -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g yarn@1
13 changes: 13 additions & 0 deletions 3.3/20/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ruby:3.3-rc-alpine
LABEL maintainer "Tim Brust <github@timbrust.de>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT

RUN echo @edge https://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \
&& echo @edge https://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories \
&& apk -U upgrade \
&& apk add --no-cache \
nodejs@edge \
npm@edge \
yarn
25 changes: 25 additions & 0 deletions 3.3/20/slim/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ruby:3.3-rc-slim
LABEL maintainer "Tim Brust <github@timbrust.de>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT
ARG NODE_MAJOR=20

# hadolint ignore=DL3009
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
curl \
gnupg2 \
libatomic1

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN printf 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 1001' > /etc/apt/preferences.d/nodesource \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -qq && apt-get install -qq --no-install-recommends \
nodejs \
&& apt-get upgrade -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g yarn@1
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Ruby 3.0, 3.1, 3.2 or 3.3 with Node.js 18 LTS Dockerfile
# Ruby 3.0, 3.1, 3.2 or 3.3 with Node.js 18 LTS or Node.js 20 LTS Dockerfile

[![Docker Automated build](https://img.shields.io/docker/automated/timbru31/ruby-node.svg)](https://hub.docker.com/r/timbru31/ruby-node/)
[![buildx Status](https://github.com/timbru31/docker-ruby-node/workflows/buildx/badge.svg)](https://github.com/timbru31/docker-ruby-node/actions?query=workflow%3Abuildx)
[![Lint Dockerfiles](https://github.com/timbru31/docker-ruby-node/workflows/Lint%20Dockerfiles/badge.svg)](https://github.com/timbru31/docker-ruby-node/actions?query=workflow%3A%22Lint+Dockerfiles%22)

A minimal Dockerfile based on Ruby (3.0, 3.1, 3.2, 3.3) Dockerfile (regular, slim or alpine) with Node.js 18 LTS (Hydrogen) installed.
A minimal Dockerfile based on Ruby (3.0, 3.1, 3.2, 3.3) Dockerfile (regular, slim or alpine) with Node.js 18 LTS (Hydrogen) or Node.js 20 LTS (Iron) installed.

## What's included

- Ruby 3.0, 3.1, 3.2, 3.3
- Node.js 18 LTS (Hydrogen)
- Node.js 18 LTS (Hydrogen) or Node.js 20 LTS (Iron)
- bundled npm that comes with the respective Node.js version (latest for Node.js LTS on alpine, see [why](https://gitlab.alpinelinux.org/alpine/aports/-/commit/25b10bd1a93e12a7e49fee38b0a229281ae49fb7))
- yarn

Expand Down

0 comments on commit 2962262

Please sign in to comment.