From 34ee0243e8200d1f0697e78a35858dabf83d3deb Mon Sep 17 00:00:00 2001 From: pat-s Date: Fri, 27 Dec 2024 10:48:41 +0100 Subject: [PATCH] replace alpine with alpine-rootless --- .woodpecker/docker.yaml | 71 ++--------------------- docker/Dockerfile.agent.alpine.multiarch | 21 ------- docker/Dockerfile.cli.alpine.multiarch | 21 ------- docker/Dockerfile.server.alpine.multiarch | 15 ----- 4 files changed, 6 insertions(+), 122 deletions(-) delete mode 100644 docker/Dockerfile.agent.alpine.multiarch delete mode 100644 docker/Dockerfile.cli.alpine.multiarch delete mode 100644 docker/Dockerfile.server.alpine.multiarch diff --git a/.woodpecker/docker.yaml b/.woodpecker/docker.yaml index f69126bdb..c9a7f078a 100644 --- a/.woodpecker/docker.yaml +++ b/.woodpecker/docker.yaml @@ -183,7 +183,7 @@ steps: image: *buildx_plugin settings: repo: *publish_repos_server - dockerfile: docker/Dockerfile.server.alpine.multiarch + dockerfile: docker/Dockerfile.server.alpine.multiarch.rootless platforms: *platforms_alpine tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine'] logins: *publish_logins @@ -203,18 +203,6 @@ steps: event: tag release-server-alpine: - depends_on: - - cross-compile-server - image: *buildx_plugin - settings: - repo: *publish_repos_server - dockerfile: docker/Dockerfile.server.alpine.multiarch - platforms: *platforms_alpine - tag: ['${CI_COMMIT_TAG%%.*}-alpine', '${CI_COMMIT_TAG%.*}-alpine', '${CI_COMMIT_TAG}-alpine'] - logins: *publish_logins - when: *when-release - - release-server-alpine-rootless: depends_on: - cross-compile-server image: *buildx_plugin @@ -222,12 +210,7 @@ steps: repo: *publish_repos_server dockerfile: docker/Dockerfile.server.alpine.multiarch.rootless platforms: *platforms_alpine - tag: - [ - '${CI_COMMIT_TAG%%.*}-alpine-rootless', - '${CI_COMMIT_TAG%.*}-alpine-rootless', - '${CI_COMMIT_TAG}-alpine-rootless', - ] + tag: ['${CI_COMMIT_TAG%%.*}-alpine', '${CI_COMMIT_TAG%.*}-alpine', '${CI_COMMIT_TAG}-alpine'] logins: *publish_logins when: *when-release @@ -289,7 +272,7 @@ steps: image: *buildx_plugin settings: repo: *publish_repos_agent - dockerfile: docker/Dockerfile.agent.alpine.multiarch + dockerfile: docker/Dockerfile.agent.alpine.multiarch.rootless platforms: *platforms_alpine tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine'] logins: *publish_logins @@ -313,22 +296,6 @@ steps: when: *when-release release-agent-alpine: - depends_on: - - vendor - # we also depend on cross-compile-server as we would have to hight - # ram usage otherwise - - cross-compile-server - image: *buildx_plugin - settings: - repo: *publish_repos_agent - dockerfile: docker/Dockerfile.agent.alpine.multiarch - platforms: *platforms_alpine - tag: ['${CI_COMMIT_TAG%%.*}-alpine', '${CI_COMMIT_TAG%.*}-alpine', '${CI_COMMIT_TAG}-alpine'] - logins: *publish_logins - build_args: *build_args - when: *when-release - - release-agent-alpine-rootless: depends_on: - vendor # we also depend on cross-compile-server as we would have to hight @@ -339,12 +306,7 @@ steps: repo: *publish_repos_agent dockerfile: docker/Dockerfile.agent.alpine.multiarch.rootless platforms: *platforms_alpine - tag: - [ - '${CI_COMMIT_TAG%%.*}-alpine-rootless', - '${CI_COMMIT_TAG%.*}-alpine-rootless', - '${CI_COMMIT_TAG}-alpine-rootless', - ] + tag: ['${CI_COMMIT_TAG%%.*}-alpine', '${CI_COMMIT_TAG%.*}-alpine', '${CI_COMMIT_TAG}-alpine'] logins: *publish_logins build_args: *build_args when: *when-release @@ -404,7 +366,7 @@ steps: image: *buildx_plugin settings: repo: *publish_repos_cli - dockerfile: docker/Dockerfile.cli.alpine.multiarch + dockerfile: docker/Dockerfile.cli.alpine.multiarch.rootless platforms: *platforms_alpine tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine'] logins: *publish_logins @@ -436,30 +398,9 @@ steps: image: *buildx_plugin settings: repo: *publish_repos_cli - dockerfile: docker/Dockerfile.cli.alpine.multiarch + dockerfile: docker/Dockerfile.cli.alpine.multiarch.rootless platforms: *platforms_alpine tag: ['${CI_COMMIT_TAG%%.*}-alpine', '${CI_COMMIT_TAG%.*}-alpine', '${CI_COMMIT_TAG}-alpine'] logins: *publish_logins build_args: *build_args when: *when-release - - release-cli-alpine-rootless: - depends_on: - - vendor - # we also depend on release-agent as we would have to hight - # ram usage otherwise - - release-agent - image: *buildx_plugin - settings: - repo: *publish_repos_cli - dockerfile: docker/Dockerfile.cli.alpine.multiarch.rootless - platforms: *platforms_alpine - tag: - [ - '${CI_COMMIT_TAG%%.*}-alpine-rootless', - '${CI_COMMIT_TAG%.*}-alpine-rootless', - '${CI_COMMIT_TAG}-alpine-rootless', - ] - logins: *publish_logins - build_args: *build_args - when: *when-release diff --git a/docker/Dockerfile.agent.alpine.multiarch b/docker/Dockerfile.agent.alpine.multiarch deleted file mode 100644 index 3ce6b783f..000000000 --- a/docker/Dockerfile.agent.alpine.multiarch +++ /dev/null @@ -1,21 +0,0 @@ -FROM --platform=$BUILDPLATFORM docker.io/golang:1.23 AS build - -WORKDIR /src -COPY . . -ARG TARGETOS TARGETARCH CI_COMMIT_SHA CI_COMMIT_TAG CI_COMMIT_BRANCH -RUN --mount=type=cache,target=/root/.cache/go-build \ - --mount=type=cache,target=/go/pkg \ - make build-agent - -FROM docker.io/alpine:3.21 -RUN apk add -U --no-cache ca-certificates -ENV GODEBUG=netdns=go -# Internal setting do NOT change! Signals that woodpecker is running inside a container -ENV WOODPECKER_IN_CONTAINER=true -EXPOSE 3000 - -COPY --from=build /src/dist/woodpecker-agent /bin/ -RUN mkdir -p /etc/woodpecker - -HEALTHCHECK CMD ["/bin/woodpecker-agent", "ping"] -ENTRYPOINT ["/bin/woodpecker-agent"] diff --git a/docker/Dockerfile.cli.alpine.multiarch b/docker/Dockerfile.cli.alpine.multiarch deleted file mode 100644 index 3768c0373..000000000 --- a/docker/Dockerfile.cli.alpine.multiarch +++ /dev/null @@ -1,21 +0,0 @@ -FROM --platform=$BUILDPLATFORM docker.io/golang:1.23 AS build - -WORKDIR /src -COPY . . -ARG TARGETOS TARGETARCH CI_COMMIT_SHA CI_COMMIT_TAG CI_COMMIT_BRANCH -RUN --mount=type=cache,target=/root/.cache/go-build \ - --mount=type=cache,target=/go/pkg \ - make build-cli - -FROM docker.io/alpine:3.21 -WORKDIR /woodpecker - -RUN apk add -U --no-cache ca-certificates - -ENV GODEBUG=netdns=go -ENV WOODPECKER_DISABLE_UPDATE_CHECK=true - -COPY --from=build /src/dist/woodpecker-cli /bin/ - -HEALTHCHECK CMD ["/bin/woodpecker-cli", "ping"] -ENTRYPOINT ["/bin/woodpecker-cli"] diff --git a/docker/Dockerfile.server.alpine.multiarch b/docker/Dockerfile.server.alpine.multiarch deleted file mode 100644 index ae7d5fc38..000000000 --- a/docker/Dockerfile.server.alpine.multiarch +++ /dev/null @@ -1,15 +0,0 @@ -FROM docker.io/alpine:3.21 - -ARG TARGETOS TARGETARCH -RUN apk add -U --no-cache ca-certificates -ENV GODEBUG=netdns=go -# Internal setting do NOT change! Signals that woodpecker is running inside a container -ENV WOODPECKER_IN_CONTAINER=true -ENV XDG_CACHE_HOME=/var/lib/woodpecker -ENV XDG_DATA_HOME=/var/lib/woodpecker -EXPOSE 8000 9000 80 443 - -COPY dist/server/${TARGETOS}_${TARGETARCH}/woodpecker-server /bin/ - -HEALTHCHECK CMD ["/bin/woodpecker-server", "ping"] -ENTRYPOINT ["/bin/woodpecker-server"]