From 86574d94568b11117207659d5d451f0fd2f25878 Mon Sep 17 00:00:00 2001 From: appleboy Date: Fri, 4 Oct 2024 15:15:23 +0800 Subject: [PATCH] build: consolidate Dockerfiles for multi-architecture support - Add a new Dockerfile for multi-architecture support using Alpine 3.20 - Remove Dockerfile for linux.amd64 - Remove Dockerfile for linux.arm - Remove Dockerfile for linux.arm64 - Remove Dockerfile for windows - Remove Docker manifest template file Signed-off-by: appleboy --- docker/Dockerfile | 20 ++++++++++++++++++++ docker/Dockerfile.linux.amd64 | 10 ---------- docker/Dockerfile.linux.arm | 10 ---------- docker/Dockerfile.linux.arm64 | 10 ---------- docker/Dockerfile.windows | 10 ---------- docker/manifest.tmpl | 25 ------------------------- 6 files changed, 20 insertions(+), 65 deletions(-) create mode 100644 docker/Dockerfile delete mode 100644 docker/Dockerfile.linux.amd64 delete mode 100644 docker/Dockerfile.linux.arm delete mode 100644 docker/Dockerfile.linux.arm64 delete mode 100644 docker/Dockerfile.windows delete mode 100644 docker/manifest.tmpl diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..d2ee370 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,20 @@ +FROM alpine:3.20 + +ARG TARGETOS +ARG TARGETARCH + +LABEL maintainer="Bo-Yi Wu " \ + org.label-schema.name="Drone Jenkins Plugin" \ + org.label-schema.vendor="Bo-Yi Wu" \ + org.label-schema.schema-version="1.0" + +LABEL org.opencontainers.image.source=https://github.com/appleboy/drone-jenkins +LABEL org.opencontainers.image.description="Drone Jenkins" +LABEL org.opencontainers.image.licenses=MIT + +RUN apk add --no-cache ca-certificates && \ + rm -rf /var/cache/apk/* + +COPY release/${TARGETOS}/${TARGETARCH}/drone-jenkins /bin/ + +ENTRYPOINT ["/bin/drone-jenkins"] diff --git a/docker/Dockerfile.linux.amd64 b/docker/Dockerfile.linux.amd64 deleted file mode 100644 index 2404b0c..0000000 --- a/docker/Dockerfile.linux.amd64 +++ /dev/null @@ -1,10 +0,0 @@ -FROM plugins/base:linux-amd64 - -LABEL maintainer="Bo-Yi Wu " \ - org.label-schema.name="Drone Jenkins" \ - org.label-schema.vendor="Bo-Yi Wu" \ - org.label-schema.schema-version="1.0" - -COPY release/linux/amd64/drone-jenkins /bin/ - -ENTRYPOINT ["/bin/drone-jenkins"] diff --git a/docker/Dockerfile.linux.arm b/docker/Dockerfile.linux.arm deleted file mode 100644 index 62e4903..0000000 --- a/docker/Dockerfile.linux.arm +++ /dev/null @@ -1,10 +0,0 @@ -FROM plugins/base:linux-arm - -LABEL maintainer="Bo-Yi Wu " \ - org.label-schema.name="Drone Jenkins" \ - org.label-schema.vendor="Bo-Yi Wu" \ - org.label-schema.schema-version="1.0" - -COPY release/linux/arm/drone-jenkins /bin/ - -ENTRYPOINT ["/bin/drone-jenkins"] diff --git a/docker/Dockerfile.linux.arm64 b/docker/Dockerfile.linux.arm64 deleted file mode 100644 index 2138f78..0000000 --- a/docker/Dockerfile.linux.arm64 +++ /dev/null @@ -1,10 +0,0 @@ -FROM plugins/base:linux-arm64 - -LABEL maintainer="Bo-Yi Wu " \ - org.label-schema.name="Drone Jenkins" \ - org.label-schema.vendor="Bo-Yi Wu" \ - org.label-schema.schema-version="1.0" - -COPY release/linux/arm64/drone-jenkins /bin/ - -ENTRYPOINT ["/bin/drone-jenkins"] diff --git a/docker/Dockerfile.windows b/docker/Dockerfile.windows deleted file mode 100644 index 36be61f..0000000 --- a/docker/Dockerfile.windows +++ /dev/null @@ -1,10 +0,0 @@ -FROM plugins/base:windows-amd64 - -LABEL maintainer="Bo-Yi Wu " \ - org.label-schema.name="Drone Jenkins" \ - org.label-schema.vendor="Bo-Yi Wu" \ - org.label-schema.schema-version="1.0" - -COPY release/drone-jenkins.exe /drone-jenkins.exe - -ENTRYPOINT [ "\\drone-jenkins.exe" ] diff --git a/docker/manifest.tmpl b/docker/manifest.tmpl deleted file mode 100644 index 0af86b0..0000000 --- a/docker/manifest.tmpl +++ /dev/null @@ -1,25 +0,0 @@ -image: appleboy/drone-jenkins:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} -{{#if build.tags}} -tags: -{{#each build.tags}} - - {{this}} -{{/each}} -{{/if}} -manifests: - - - image: appleboy/drone-jenkins:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 - platform: - architecture: amd64 - os: linux - - - image: appleboy/drone-jenkins:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64 - platform: - architecture: arm64 - os: linux - variant: v8 - - - image: appleboy/drone-jenkins:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm - platform: - architecture: arm - os: linux - variant: v7