Skip to content

Commit

Permalink
Ubuntu 18.04 -> 24.04, Dockerfile tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
DrJosh9000 committed Nov 11, 2024
1 parent db85764 commit ea37593
Show file tree
Hide file tree
Showing 13 changed files with 149 additions and 99 deletions.
6 changes: 3 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ steps:
setup:
- "alpine"
- "alpine-k8s"
- "ubuntu-18.04"
- "ubuntu-20.04"
- "ubuntu-22.04"
- "ubuntu-24.04"
- "sidecar"

- group: ":docker: Docker Image Tests"
Expand All @@ -216,9 +216,9 @@ steps:
variant:
- alpine
- alpine-k8s
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
- sidecar

- name: ":docker: {{matrix.variant}} arm64 image test"
Expand All @@ -240,9 +240,9 @@ steps:
variant:
- alpine
- alpine-k8s
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
- sidecar

- name: ":debian: Debian package build"
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/steps/build-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -Eeufo pipefail

## This script can be run locally like this:
##
## .buildkite/steps/build-docker-image.sh (alpine|alpine-k8s|ubuntu-18.04|ubuntu-20.04|ubuntu-22.04|sidecar) (image tag) (codename) (version)
## .buildkite/steps/build-docker-image.sh (alpine|alpine-k8s|ubuntu-20.04|ubuntu-22.04|ubuntu-24.04|sidecar) (image tag) (codename) (version)
## e.g: .buildkite/steps/build-docker-image.sh alpine buildkiteci/agent:lox-manual-build stable 3.1.1
##
## You can then publish that image with
Expand All @@ -21,7 +21,7 @@ codename="${3:-}"
version="${4:-}"
push="${PUSH_IMAGE:-true}"

if [[ ! "$variant" =~ ^(alpine|alpine-k8s|ubuntu-18\.04|ubuntu-20\.04|ubuntu-22\.04|sidecar)$ ]]; then
if [[ ! "$variant" =~ ^(alpine|alpine-k8s|ubuntu-20\.04|ubuntu-22\.04|ubuntu-24\.04|sidecar)$ ]]; then
echo "Unknown docker variant $variant"
exit 1
fi
Expand Down
6 changes: 3 additions & 3 deletions .buildkite/steps/extract-agent-version-metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ full_agent_version="buildkite-agent version ${agent_version}, build ${build_vers
registry="445615400570.dkr.ecr.us-east-1.amazonaws.com/agent"
docker_alpine_image_tag="$registry:alpine-build-${BUILDKITE_BUILD_NUMBER}"
docker_alpine_k8s_image_tag="$registry:alpine-k8s-build-${BUILDKITE_BUILD_NUMBER}"
docker_ubuntu_bionic_image_tag="$registry:ubuntu-18.04-build-${BUILDKITE_BUILD_NUMBER}"
docker_ubuntu_focal_image_tag="$registry:ubuntu-20.04-build-${BUILDKITE_BUILD_NUMBER}"
docker_ubuntu_jammy_image_tag="$registry:ubuntu-22.04-build-${BUILDKITE_BUILD_NUMBER}"
docker_ubuntu_noble_image_tag="$registry:ubuntu-24.04-build-${BUILDKITE_BUILD_NUMBER}"

docker_sidecar_image_tag="$registry:sidecar-build-${BUILDKITE_BUILD_NUMBER}"

Expand All @@ -24,9 +24,9 @@ echo "Full agent version: $full_agent_version"
echo "Agent version: $agent_version"
echo "Build version: $build_version"
echo "Docker Alpine Image Tag: $docker_alpine_image_tag"
echo "Docker Ubuntu 18.04 Image Tag: $docker_ubuntu_bionic_image_tag"
echo "Docker Ubuntu 20.04 Image Tag: $docker_ubuntu_focal_image_tag"
echo "Docker Ubuntu 22.04 Image Tag: $docker_ubuntu_jammy_image_tag"
echo "Docker Ubuntu 24.04 Image Tag: $docker_ubuntu_noble_image_tag"
echo "Docker Sidecar Image Tag: $docker_sidecar_image_tag"
echo "Is prerelease? $is_prerelease"

Expand All @@ -35,8 +35,8 @@ buildkite-agent meta-data set "agent-version-full" "$full_agent_version"
buildkite-agent meta-data set "agent-version-build" "$build_version"
buildkite-agent meta-data set "agent-docker-image-alpine" "$docker_alpine_image_tag"
buildkite-agent meta-data set "agent-docker-image-alpine-k8s" "$docker_alpine_k8s_image_tag"
buildkite-agent meta-data set "agent-docker-image-ubuntu-18.04" "$docker_ubuntu_bionic_image_tag"
buildkite-agent meta-data set "agent-docker-image-ubuntu-20.04" "$docker_ubuntu_focal_image_tag"
buildkite-agent meta-data set "agent-docker-image-ubuntu-22.04" "$docker_ubuntu_jammy_image_tag"
buildkite-agent meta-data set "agent-docker-image-ubuntu-24.04" "$docker_ubuntu_noble_image_tag"
buildkite-agent meta-data set "agent-docker-image-sidecar" "$docker_sidecar_image_tag"
buildkite-agent meta-data set "agent-is-prerelease" "$is_prerelease"
2 changes: 1 addition & 1 deletion .buildkite/steps/publish-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ esac
version="$(buildkite-agent meta-data get "agent-version")"
build="$(buildkite-agent meta-data get "agent-version-build")"

for variant in "alpine" "alpine-k8s" "ubuntu-18.04" "ubuntu-20.04" "ubuntu-22.04" "sidecar" ; do
for variant in "alpine" "alpine-k8s" "ubuntu-20.04" "ubuntu-22.04" "ubuntu-24.04" "sidecar" ; do
echo "--- Getting docker image tag for $variant from build meta data"
source_image="$(buildkite-agent meta-data get "agent-docker-image-${variant}")"
echo "Docker Image Tag for ${variant}: ${source_image}"
Expand Down
5 changes: 3 additions & 2 deletions .buildkite/steps/upload-release-steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ trigger_step() {
agent-version-full: "${full_agent_version}"
agent-docker-image-alpine: "${agent_docker_image_alpine}"
'agent-docker-image-alpine-k8s': "${agent_docker_image_alpine_k8s}"
'agent-docker-image-ubuntu-18.04': "${agent_docker_image_ubuntu_bionic}"
'agent-docker-image-ubuntu-20.04': "${agent_docker_image_ubuntu_focal}"
'agent-docker-image-ubuntu-22.04': "${agent_docker_image_ubuntu_jammy}"
'agent-docker-image-ubuntu-24.04': "${agent_docker_image_ubuntu_noble}"
agent-docker-image-sidecar: "${agent_docker_image_sidecar}"
agent-is-prerelease: "${agent_is_prerelease}"
env:
Expand Down Expand Up @@ -76,9 +76,10 @@ build_version=$(buildkite-agent meta-data get "agent-version-build")
full_agent_version=$(buildkite-agent meta-data get "agent-version-full")
agent_docker_image_alpine=$(buildkite-agent meta-data get "agent-docker-image-alpine")
agent_docker_image_alpine_k8s=$(buildkite-agent meta-data get "agent-docker-image-alpine-k8s")
agent_docker_image_ubuntu_bionic=$(buildkite-agent meta-data get "agent-docker-image-ubuntu-18.04")
agent_docker_image_ubuntu_focal=$(buildkite-agent meta-data get "agent-docker-image-ubuntu-20.04")
agent_docker_image_ubuntu_jammy=$(buildkite-agent meta-data get "agent-docker-image-ubuntu-22.04")
agent_docker_image_ubuntu_noble=$(buildkite-agent meta-data get "agent-docker-image-ubuntu-24.04")

agent_docker_image_sidecar=$(buildkite-agent meta-data get "agent-docker-image-sidecar")
agent_is_prerelease=$(buildkite-agent meta-data get "agent-is-prerelease")

Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ updates:
- /packaging/docker/alpine
- /packaging/docker/alpine-k8s
- /packaging/docker/sidecar
- /packaging/docker/ubuntu-18.04
- /packaging/docker/ubuntu-20.04
- /packaging/docker/ubuntu-22.04
- /packaging/docker/ubuntu-24.04
schedule:
interval: weekly
ignore:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ For example, agent version 3.45.6 is published as:
#### Supported operating systems

- Alpine 3.18
- Ubuntu 18.04 LTS (x86_64), supported to end of standard support for 18.04
- Ubuntu 20.04 LTS (x86_64), supported to end of standard support for 20.04
- Ubuntu 22.04 LTS (x86_64), supported to end of standard support for 22.04
- Ubuntu 24.04 LTS (x86_64), supported to end of standard support for 24.04

## Starting

Expand Down Expand Up @@ -172,7 +172,7 @@ release).
The agent binary is fairly portable and should run out of the box on most UNIX
like systems, as well as Windows.

- Ubuntu 18.04 and newer
- Ubuntu 20.04 and newer
- Debian 8 and newer
- Red Hat RHEL 7 and newer
- CentOS
Expand Down
48 changes: 0 additions & 48 deletions packaging/docker/ubuntu-18.04/Dockerfile

This file was deleted.

80 changes: 49 additions & 31 deletions packaging/docker/ubuntu-20.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,59 @@ FROM public.ecr.aws/ubuntu/ubuntu:20.04@sha256:4a885c102bc7de9ff2ffc4b11b65f35e4
ARG TARGETOS
ARG TARGETARCH

ENV DEBIAN_FRONTEND=noninteractive
ENV DOCKER_COMPOSE_VERSION=1.27.4

RUN apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https \
bash \
ca-certificates \
curl \
git \
gnupg-agent \
jq \
openssh-client \
perl \
python \
python3-pip \
rsync \
software-properties-common \
tini \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& add-apt-repository \
"deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install -y --no-install-recommends docker-ce-cli docker-compose-plugin docker-buildx-plugin \
&& rm -rf /var/lib/apt/lists/* \
&& pip3 install docker-compose==$DOCKER_COMPOSE_VERSION
RUN <<BASH
#!/usr/bin/env bash

ENV BUILDKITE_AGENT_CONFIG=/buildkite/buildkite-agent.cfg \
PATH="/usr/local/bin:${PATH}"
set -eufo pipefail

export DEBIAN_FRONTEND=noninteractive

# Install main packages
apt-get update
apt-get install -y --no-install-recommends \
apt-transport-https \
bash \
ca-certificates \
curl \
git \
gnupg-agent \
jq \
openssh-client \
perl \
python3 \
python3-pip \
rsync \
software-properties-common \
tini

# Install Docker Engine
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null

RUN ln -s /usr/bin/tini /usr/sbin/tini
# 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

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
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
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
Expand Down
22 changes: 17 additions & 5 deletions packaging/docker/ubuntu-22.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set -eufo pipefail

export DEBIAN_FRONTEND=noninteractive

# Install main packages
apt-get update
apt-get install -y --no-install-recommends \
apt-transport-https \
Expand All @@ -29,10 +30,21 @@ apt-get install -y --no-install-recommends \
software-properties-common \
tini

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
apt-get install -y --no-install-recommends docker-ce-cli docker-compose-plugin docker-buildx-plugin
# Install Docker Engine
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /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
Expand All @@ -43,7 +55,7 @@ chmod +x /usr/local/bin/ssh-env-config.sh
BASH

ENV BUILDKITE_AGENT_CONFIG=/buildkite/buildkite-agent.cfg \
PATH="/usr/local/bin:${PATH}"
PATH="/usr/local/bin:${PATH}"

COPY ./docker-compose /usr/local/bin/docker-compose
COPY ./buildkite-agent.cfg /buildkite/buildkite-agent.cfg
Expand Down
67 changes: 67 additions & 0 deletions packaging/docker/ubuntu-24.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# syntax=docker/dockerfile:1.4

FROM public.ecr.aws/ubuntu/ubuntu:24.04@sha256:fb95efe0d22be277f10250f15e5172ec0fe22c37eca2ba55e78b526c447eec23

ARG TARGETOS
ARG TARGETARCH

RUN <<BASH
#!/usr/bin/env bash

set -eufo pipefail

export DEBIAN_FRONTEND=noninteractive

# Install main packages
apt-get update
apt-get install -y --no-install-recommends \
apt-transport-https \
bash \
ca-certificates \
curl \
git \
gnupg-agent \
jq \
openssh-client \
perl \
python3 \
python3-pip \
rsync \
software-properties-common \
tini

# Install Docker Engine
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /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
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

VOLUME /buildkite
ENTRYPOINT ["buildkite-agent-entrypoint"]
CMD ["start"]
Loading

0 comments on commit ea37593

Please sign in to comment.