Skip to content

Commit

Permalink
feat: squashed layers
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Volkov committed May 16, 2023
1 parent 1c52c5b commit 7fdac90
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions packages/dind/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# syntax docker/dockerfile:latest
ARG nodejs_version=18
ARG pulumi_version="3.67.1"
FROM pulumi/pulumi:${pulumi_version} AS pulumi
FROM summerwind/actions-runner-dind:ubuntu-22.04 AS base
USER runner


ARG nodejs_version="18.16.0"
FROM base AS build
LABEL org.opencontainers.image.authors="BN Enginseers <[email protected]>" \
org.opencontainers.image.url="https://github.com/bn-digital/docker" \
Expand All @@ -11,9 +15,12 @@ LABEL org.opencontainers.image.authors="BN Enginseers <[email protected]>" \
org.opencontainers.image.title="NodeJS DinD Build Pack for Github Workflows" \
org.opencontainers.image.description="Base environment used for building NodeJS applications in Docker with Github Action runner"
USER root
COPY --from=pulumi /usr/local/aws-cli/v2/current /home/runner/.local/aws
COPY --from=pulumi /usr/bin/pulumi /home/runner/.local/bin/pulumi
COPY --from=pulumi /usr/bin/kubectl /home/runner/.local/bin/kubectl
RUN apt-get update --fix-missing \
&& apt-get upgrade --yes \
&& apt-get dist-upgrade --yes \
&& apt-get full-upgrade --yes \
&& apt-get install --no-install-recommends --no-install-suggests --yes \
apt-transport-https \
bash \
Expand All @@ -29,12 +36,13 @@ RUN apt-get update --fix-missing \
wget \
&& curl -fsSL https://deb.nodesource.com/setup_${nodejs_version}.x | bash - \
&& apt-get update \
&& apt-get install --yes nodejs \
&& npm install --global yarn npm \
&& apt-get install --yes nodejs npm \
&& npm install --global yarn \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/* /requirements.apt
&& rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/* /requirements.apt \
&& ln -s /home/runner/.local/aws/bin/aws /home/runner/.local/bin/aws

FROM base
USER runner
COPY --from=build / /
COPY --from=build --chown=runner /home/runner /home/runner

0 comments on commit 7fdac90

Please sign in to comment.