From 96223f722d7c121d727b9c1553e9888ab7cf3bf0 Mon Sep 17 00:00:00 2001 From: Josh Deprez Date: Thu, 14 Nov 2024 11:12:37 +1100 Subject: [PATCH] Switch to agent-base images --- .buildkite/steps/build-docker-image.sh | 1 - .github/dependabot.yml | 12 +++-- packaging/docker/alpine-k8s/Dockerfile | 55 +---------------------- packaging/docker/alpine/Dockerfile | 24 +--------- packaging/docker/common/docker-compose | 20 --------- packaging/docker/ubuntu-20.04/Dockerfile | 57 +++--------------------- packaging/docker/ubuntu-22.04/Dockerfile | 57 +++--------------------- packaging/docker/ubuntu-24.04/Dockerfile | 57 +++--------------------- 8 files changed, 23 insertions(+), 260 deletions(-) delete mode 100755 packaging/docker/common/docker-compose diff --git a/.buildkite/steps/build-docker-image.sh b/.buildkite/steps/build-docker-image.sh index 1af8647d2b..4e7215fd5b 100755 --- a/.buildkite/steps/build-docker-image.sh +++ b/.buildkite/steps/build-docker-image.sh @@ -63,7 +63,6 @@ trap "docker buildx rm $builder_name || true" EXIT echo --- Copying files into build context cp -a packaging/linux/root/usr/share/buildkite-agent/hooks/ "${packaging_dir}/hooks/" cp pkg/buildkite-agent-linux-{amd64,arm64} "$packaging_dir" -cp packaging/docker/common/docker-compose "$packaging_dir" echo "--- Building :docker: $image_tag for all architectures" docker buildx build --progress plain --builder "$builder_name" --platform linux/amd64,linux/arm64 "$packaging_dir" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 227662ee2a..daff892c97 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,8 +10,6 @@ updates: - /packaging/docker/ubuntu-24.04 schedule: interval: weekly - ignore: - - dependency-name: ubuntu - package-ecosystem: gomod directory: / schedule: @@ -20,12 +18,12 @@ updates: groups: otel: patterns: - - go.opentelemetry.io/* + - go.opentelemetry.io/* golang-x: patterns: - - golang.org/x/* + - golang.org/x/* cloud-providers: patterns: - - github.com/Azure/* - - github.com/aws/* - - google.golang.org/* + - github.com/Azure/* + - github.com/aws/* + - google.golang.org/* diff --git a/packaging/docker/alpine-k8s/Dockerfile b/packaging/docker/alpine-k8s/Dockerfile index 4026024eb2..18d5aad842 100644 --- a/packaging/docker/alpine-k8s/Dockerfile +++ b/packaging/docker/alpine-k8s/Dockerfile @@ -1,62 +1,9 @@ # syntax=docker/dockerfile:1.4 -FROM public.ecr.aws/docker/library/alpine:3.20.3@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d AS base - -RUN apk update && apk add --no-cache \ - bash \ - curl \ - docker-cli \ - docker-cli-buildx \ - docker-cli-compose \ - git \ - jq \ - libc6-compat \ - openssh-client \ - perl \ - py-pip \ - rsync \ - run-parts \ - su-exec \ - tini \ - tini-static \ - tzdata - -COPY docker-compose /usr/local/bin/docker-compose - -FROM public.ecr.aws/docker/library/alpine:3.20.3@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d AS kubectl-downloader -ARG TARGETOS -ARG TARGETARCH - -ENV K8_VERSION=v1.31.0 - -RUN < /dev/null - -# We just updated the main sources. This only updates the docker source -apt-get update -o Dir::Etc::sourcelist="sources.list.d/docker.list" \ - -o Dir::Etc::sourceparts="-" \ - -o APT::Get::List-Cleanup="0" -apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - -rm -rf /var/lib/apt/lists/* - -ln -s /usr/bin/tini /usr/sbin/tini - -mkdir -p /buildkite/builds /buildkite/hooks /buildkite/plugins -curl -Lfs -o /usr/local/bin/ssh-env-config.sh https://raw.githubusercontent.com/buildkite/docker-ssh-env-config/master/ssh-env-config.sh -chmod +x /usr/local/bin/ssh-env-config.sh -BASH - ENV BUILDKITE_AGENT_CONFIG=/buildkite/buildkite-agent.cfg \ PATH="/usr/local/bin:${PATH}" -COPY ./docker-compose /usr/local/bin/docker-compose +RUN mkdir -p /buildkite/builds /buildkite/hooks /buildkite/plugins \ + && curl -Lfs -o /usr/local/bin/ssh-env-config.sh https://raw.githubusercontent.com/buildkite/docker-ssh-env-config/master/ssh-env-config.sh \ + && chmod +x /usr/local/bin/ssh-env-config.sh + COPY ./buildkite-agent.cfg /buildkite/buildkite-agent.cfg COPY ./buildkite-agent-$TARGETOS-$TARGETARCH /usr/local/bin/buildkite-agent COPY ./entrypoint.sh /usr/local/bin/buildkite-agent-entrypoint diff --git a/packaging/docker/ubuntu-22.04/Dockerfile b/packaging/docker/ubuntu-22.04/Dockerfile index 105d18c2e7..07769cc47a 100644 --- a/packaging/docker/ubuntu-22.04/Dockerfile +++ b/packaging/docker/ubuntu-22.04/Dockerfile @@ -1,63 +1,16 @@ # syntax=docker/dockerfile:1.4 -FROM public.ecr.aws/ubuntu/ubuntu:22.04@sha256:1582c29f34a48752e406f1a261fe9545fad895da3f6bb4be55bc82485557564e - +FROM public.ecr.aws/buildkite/agent-base:ubuntu-22.04@sha256:ca90fbc56ff1813f486bc3d3787c4d2802f31eede330baf1dde3d6923ee89ea6 ARG TARGETOS ARG TARGETARCH -RUN < /dev/null - -# We just updated the main sources. This only updates the docker source -apt-get update -o Dir::Etc::sourcelist="sources.list.d/docker.list" \ - -o Dir::Etc::sourceparts="-" \ - -o APT::Get::List-Cleanup="0" -apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - -rm -rf /var/lib/apt/lists/* - -ln -s /usr/bin/tini /usr/sbin/tini - -mkdir -p /buildkite/builds /buildkite/hooks /buildkite/plugins -curl -Lfs -o /usr/local/bin/ssh-env-config.sh https://raw.githubusercontent.com/buildkite/docker-ssh-env-config/master/ssh-env-config.sh -chmod +x /usr/local/bin/ssh-env-config.sh -BASH - ENV BUILDKITE_AGENT_CONFIG=/buildkite/buildkite-agent.cfg \ PATH="/usr/local/bin:${PATH}" -COPY ./docker-compose /usr/local/bin/docker-compose +RUN mkdir -p /buildkite/builds /buildkite/hooks /buildkite/plugins \ + && curl -Lfs -o /usr/local/bin/ssh-env-config.sh https://raw.githubusercontent.com/buildkite/docker-ssh-env-config/master/ssh-env-config.sh \ + && chmod +x /usr/local/bin/ssh-env-config.sh + COPY ./buildkite-agent.cfg /buildkite/buildkite-agent.cfg COPY ./buildkite-agent-$TARGETOS-$TARGETARCH /usr/local/bin/buildkite-agent COPY ./entrypoint.sh /usr/local/bin/buildkite-agent-entrypoint diff --git a/packaging/docker/ubuntu-24.04/Dockerfile b/packaging/docker/ubuntu-24.04/Dockerfile index 375eb24663..f7af3c9a44 100644 --- a/packaging/docker/ubuntu-24.04/Dockerfile +++ b/packaging/docker/ubuntu-24.04/Dockerfile @@ -1,63 +1,16 @@ # syntax=docker/dockerfile:1.4 -FROM public.ecr.aws/ubuntu/ubuntu:24.04@sha256:fb95efe0d22be277f10250f15e5172ec0fe22c37eca2ba55e78b526c447eec23 - +FROM public.ecr.aws/buildkite/agent-base:ubuntu-24.04@sha256:7a48132055c0356b422b2d6a977987d22af65f14d45c357531dbf290e58b66aa ARG TARGETOS ARG TARGETARCH -RUN < /dev/null - -# We just updated the main sources. This only updates the docker source -apt-get update -o Dir::Etc::sourcelist="sources.list.d/docker.list" \ - -o Dir::Etc::sourceparts="-" \ - -o APT::Get::List-Cleanup="0" -apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - -rm -rf /var/lib/apt/lists/* - -ln -s /usr/bin/tini /usr/sbin/tini - -mkdir -p /buildkite/builds /buildkite/hooks /buildkite/plugins -curl -Lfs -o /usr/local/bin/ssh-env-config.sh https://raw.githubusercontent.com/buildkite/docker-ssh-env-config/master/ssh-env-config.sh -chmod +x /usr/local/bin/ssh-env-config.sh -BASH - ENV BUILDKITE_AGENT_CONFIG=/buildkite/buildkite-agent.cfg \ PATH="/usr/local/bin:${PATH}" -COPY ./docker-compose /usr/local/bin/docker-compose +RUN mkdir -p /buildkite/builds /buildkite/hooks /buildkite/plugins \ + && curl -Lfs -o /usr/local/bin/ssh-env-config.sh https://raw.githubusercontent.com/buildkite/docker-ssh-env-config/master/ssh-env-config.sh \ + && chmod +x /usr/local/bin/ssh-env-config.sh + COPY ./buildkite-agent.cfg /buildkite/buildkite-agent.cfg COPY ./buildkite-agent-$TARGETOS-$TARGETARCH /usr/local/bin/buildkite-agent COPY ./entrypoint.sh /usr/local/bin/buildkite-agent-entrypoint