From f224f0cfa3a16b4a12a29d45b6c43c01d6bdea58 Mon Sep 17 00:00:00 2001 From: Rene Leonhardt <65483435+reneleonhardt@users.noreply.github.com> Date: Sat, 4 Nov 2023 09:40:10 +0100 Subject: [PATCH] feat: add Docker image (Linux x64) * Rootless Docker image (not multi-arch) * Allow Dependabot to update Docker and GitHub Actions --- .dockerignore | 19 +++++++++++++++++++ .github/dependabot.yml | 10 ++++++++++ Dockerfile | 22 ++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 .dockerignore create mode 100644 .github/dependabot.yml create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000000..61925490a35 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,19 @@ +.git/ +.github/ +.idea/ +cmd/ +compat-table/ +docs/ +images/ +internal/ +lib/ +npm/ +pkg/ +require/ +scripts/ +*.md +*.sh +.* +Dockerfile +Makefile +go.* diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..7629a45bb2b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..59c447699c3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM alpine:3 + +WORKDIR /tmp +COPY version.txt . +RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app \ + && wget -c https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-$(cat version.txt).tgz -O - | tar -xz + +FROM scratch + +COPY --from=0 /etc/passwd /etc/group /etc/ +COPY --from=0 --chown=1000:1000 /tmp/package/bin/esbuild /bin/ +USER app + +LABEL org.opencontainers.image.authors="Evan Wallace" +LABEL org.opencontainers.image.base.name="docker.io/library/scratch" +LABEL org.opencontainers.image.description="An extremely fast bundler for the web" +LABEL org.opencontainers.image.licenses="MIT" +LABEL org.opencontainers.image.source="https://github.com/evanw/esbuild" +LABEL org.opencontainers.image.title="esbuild" +LABEL org.opencontainers.image.version="0.19.5" + +ENTRYPOINT ["/bin/esbuild"]