Skip to content

Commit

Permalink
ZWOO-509 update to dotnet 9, node 22, remove yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankachlock committed Nov 14, 2024
1 parent f6f3e25 commit 68d8081
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3
with:
Expand All @@ -31,7 +31,7 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # pin@v6
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # pin@v6
with:
context: .
push: true
Expand Down
58 changes: 7 additions & 51 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ LABEL org.opencontainers.image.description="the base image for building zwoo rel

WORKDIR /temp/zwooc

ENV \
# Zwooc version
ZWOOC_VERSION=1.1.0
ENV ZWOOC_VERSION=1.1.1

# Download zwooc from GitHub releases
RUN apt-get update && apt-get install -y curl \
Expand All @@ -18,13 +16,11 @@ RUN apt-get update && apt-get install -y curl \
&& chmod +x zwooc \
&& ./zwooc -h

FROM mcr.microsoft.com/dotnet/sdk:8.0.401-bookworm-slim-amd64
FROM mcr.microsoft.com/dotnet/sdk:9.0.100-bookworm-slim-amd64

ENV \
# Node.js version
NODE_VERSION=20.16.0 \
# Yarn version
YARN_VERSION=1.22.22
# Node 22, see: https://github.com/nodejs/docker-node/blob/main/22/bookworm-slim/Dockerfile

ENV NODE_VERSION=21.11.0

RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
Expand All @@ -47,18 +43,14 @@ RUN ARCH= OPENSSL_ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& export GNUPGHOME="$(mktemp -d)" \
# gpg keys listed at https://github.com/nodejs/node#release-keys
&& for key in \
4ED778F539E3634C779C87C6D7062848A1AB005C \
141F07595B7B3FFE74309A937405533BE57C7D57 \
74F12602B6F1C4E913FAA37AD3A89613643B6201 \
C0D6248439F1D5604AAFFB4021D900FFDB233756 \
DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 \
61FC681DFB92A079F1685E77973F295594EC4689 \
CC68F5A3106FF448322E48ED27F5E38D5B0A215F \
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
108F52B48DB57BB0CC439B2997B01419BD92F80A \
A363A499291CBBC940DD62E41F10027AF002F8B0 \
CC68F5A3106FF448322E48ED27F5E38D5B0A215F \
; do \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
Expand Down Expand Up @@ -87,42 +79,6 @@ RUN ARCH= OPENSSL_ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& node --version \
&& npm --version

RUN set -ex \
&& savedAptMark="$(apt-mark showmanual)" \
&& apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr --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 \
6A010C5166006599AA17F08146C2130DFD2497F5 \
; do \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
done \
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& gpgconf --kill all \
&& rm -rf "$GNUPGHOME" \
&& mkdir -p /opt \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& apt-mark auto '.*' > /dev/null \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \
| xargs -r dpkg-query --search \
| cut -d: -f1 \
| sort -u \
| xargs -r apt-mark manual \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
# smoke test
&& yarn --version \
&& rm -rf /tmp/*

# Instal dotnet wasm dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ This is the base image for the build stage of all zwoo docker images.

It is composed of:

- `mcr.microsoft.com/dotnet/sdk:8.0.401-bookworm-slim-amd64` (using `debian:bookworm-slim` as base)
- `node:20.16.0-bookworm-slim`
- `zwooc` v1.1.0
- `mcr.microsoft.com/dotnet/sdk:9.0.100-bookworm-slim-amd64` (using `debian:bookworm-slim` as base)
- `node:22.11.0-bookworm-slim`
- `zwooc` v1.1.1

It should only be used for the build stage. The production image depend on the technology used. Common images are:

- `nginx:stable-alpine` (frontend/docs)
- `mcr.microsoft.com/dotnet/aspnet:8.0` (backend)
- `mcr.microsoft.com/dotnet/aspnet:9.0` (backend)

## version compatibilities

| image version | included |
| ------------- | ------------------------------------------------------------------------------------------------------------------ |
| v0.1.0 | alpine:3.19.2 <br> dotnet-sdk:8.0.6 <br> node:20.15.0 <br> zwooc:1.0.1 |
| v0.2.0 | debian:bookworm-slim <br> mcr.microsoft.com/dotnet/sdk:8.0.401 <br> node:20.16.0 <br> yarn:1.22.22 <br>zwooc:1.1.0 |
| v1.0.0 | debian:bookworm-slim <br> mcr.microsoft.com/dotnet/sdk:9.0.100 <br> node:22.11.0 <br>zwooc:1.1.1 |
| v0.2.0 | debian:bookworm-slim <br> mcr.microsoft.com/dotnet/sdk:8.0.401 <br> node:20.16.0 <br> yarn:1.22.22 <br>zwooc:1.1.0 |
| v0.1.0 | alpine:3.19.2 <br> dotnet-sdk:8.0.6 <br> node:20.15.0 <br> zwooc:1.0.1 |

0 comments on commit 68d8081

Please sign in to comment.