|
| 1 | +# Base image containing dependencies used in builder and final image |
| 2 | +FROM ghcr.io/swissgrc/azure-pipelines-dotnet:9.0.100 AS base |
| 3 | + |
| 4 | + |
| 5 | +# Builder image |
| 6 | +FROM base AS build |
| 7 | + |
| 8 | +# Make sure to fail due to an error at any stage in shell pipes |
| 9 | +SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
| 10 | + |
| 11 | +# renovate: datasource=repology depName=debian_12/curl versioning=deb |
| 12 | +ENV CURL_VERSION=7.88.1-10+deb12u8 |
| 13 | +# renovate: datasource=repology depName=debian_12/gnupg2 versioning=deb |
| 14 | +ENV GNUPG_VERSION=2.2.40-1.1 |
| 15 | + |
| 16 | +RUN apt-get update -y && \ |
| 17 | + # Install necessary dependencies |
| 18 | + apt-get install -y --no-install-recommends \ |
| 19 | + curl=${CURL_VERSION} \ |
| 20 | + gnupg=${GNUPG_VERSION} && \ |
| 21 | + # Add NodeJS PPA |
| 22 | + curl --proto "=https" -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \ |
| 23 | + | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ |
| 24 | + NODE_MAJOR=22 && \ |
| 25 | + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" \ |
| 26 | + | tee /etc/apt/sources.list.d/nodesource.list |
| 27 | + |
| 28 | + |
| 29 | +# Final image |
| 30 | +FROM base AS final |
| 31 | + |
| 32 | +LABEL org.opencontainers.image.vendor="Swiss GRC AG" |
| 33 | +LABEL org.opencontainers.image.authors= "Swiss GRC AG <[email protected]>" |
| 34 | +LABEL org.opencontainers.image.title="azure-pipelines-node" |
| 35 | +LABEL org.opencontainers.image.documentation="https://github.com/swissgrc/docker-azure-pipelines-node22-net9" |
| 36 | + |
| 37 | +# Make sure to fail due to an error at any stage in shell pipes |
| 38 | +SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
| 39 | + |
| 40 | +WORKDIR / |
| 41 | +# Copy Git LFS & NodeJS PPA keyring |
| 42 | +COPY --from=build /etc/apt/keyrings/ /etc/apt/keyrings |
| 43 | +COPY --from=build /etc/apt/sources.list.d/ /etc/apt/sources.list.d |
| 44 | + |
| 45 | +# Install NodeJS |
| 46 | + |
| 47 | +# renovate: datasource=github-tags depName=nodejs/node extractVersion=^v(?<version>.*)$ |
| 48 | +ENV NODE_VERSION=22.11.0 |
| 49 | + |
| 50 | +RUN apt-get update -y && \ |
| 51 | + # Install NodeJs |
| 52 | + apt-get install -y --no-install-recommends nodejs=${NODE_VERSION}-1nodesource1 && \ |
| 53 | + # Clean up |
| 54 | + apt-get clean && \ |
| 55 | + rm -rf /var/lib/apt/lists/* && \ |
| 56 | + # Smoke test |
| 57 | + node -v |
| 58 | + |
| 59 | +# Install Yarn |
| 60 | + |
| 61 | +# renovate: datasource=github-tags depName=yarnpkg/yarn extractVersion=^v(?<version>.*)$ |
| 62 | +ENV YARN_VERSION=1.22.22 |
| 63 | + |
| 64 | +RUN npm install -g --ignore-scripts yarn@${YARN_VERSION} && \ |
| 65 | + npm cache clean --force && \ |
| 66 | + # Smoke test |
| 67 | + yarn --version |
0 commit comments