@@ -59,28 +59,107 @@ jobs:
5959 steps :
6060 - uses : actions/checkout@v4
6161
62- - name : Install tool
62+ - name : Update Docker version
63+ # https://docs.docker.com/engine/install/ubuntu#install-using-the-repository
64+ run : |
65+ # Remove any previous installations of Podman and Docker
66+ for pkg in docker.io \
67+ docker-doc \
68+ docker-compose \
69+ docker-compose-v2 \
70+ podman-docker \
71+ containerd \
72+ crun \
73+ runc \
74+ docker-ce \
75+ docker-ce-cli \
76+ containerd.io \
77+ docker-buildx-plugin \
78+ docker-compose-plugin \
79+ podman \
80+ containers-common \
81+ crun \
82+ runc \
83+ buildah \
84+ ; do
85+ sudo apt-get remove --purge -y $pkg || true
86+ done
87+
88+ ### Docker ###
89+ # Add Docker's official GPG key:
90+ sudo apt-get update
91+ sudo apt-get install ca-certificates curl
92+ sudo install -m 0755 -d /etc/apt/keyrings
93+ sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
94+ sudo chmod a+r /etc/apt/keyrings/docker.asc
95+
96+ # Add the repository to Apt sources:
97+ echo \
98+ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
99+ $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
100+ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
101+ sudo apt-get update
102+ sudo apt-get install -y docker-ce \
103+ docker-ce-cli \
104+ containerd.io \
105+ docker-buildx-plugin \
106+ docker-compose-plugin
107+
108+ - name : Update Podman version
109+ # https://github.com/containers/podman/discussions/25582
110+ if : ${{ matrix.tool == 'podman' }}
111+ run : |
112+ ### Podman ###
113+ # Define file paths
114+ PINNING_FILE="/etc/apt/preferences.d/podman-plucky.pref"
115+ SOURCE_LIST="/etc/apt/sources.list.d/plucky.list"
116+
117+ # Write plucky APT source list
118+ echo "Adding plucky repo to $SOURCE_LIST..."
119+ echo "deb http://archive.ubuntu.com/ubuntu plucky main universe" | \
120+ sudo tee "$SOURCE_LIST"
121+
122+ # Write APT pinning rules
123+ echo "Writing APT pinning rules to $PINNING_FILE..."
124+ cat <<EOF > /tmp/pinning_file
125+ Package: podman buildah golang-github-containers-common crun libgpgme11t64 libgpg-error0 golang-github-containers-image catatonit conmon containers-storage
126+ Pin: release n=plucky
127+ Pin-Priority: 991
128+
129+ Package: libsubid4 netavark passt aardvark-dns containernetworking-plugins libslirp0 slirp4netns
130+ Pin: release n=plucky
131+ Pin-Priority: 991
132+
133+ Package: *
134+ Pin: release n=plucky
135+ Pin-Priority: 400
136+ EOF
137+ sudo mv -f /tmp/pinning_file "$PINNING_FILE"
138+
139+ # Update APT cache
140+ echo "Updating APT package list..."
141+ sudo apt-get update
142+
143+ echo "plucky pinning setup complete."
144+ sudo apt-get install -y podman podman-docker
145+
146+ - name : Configure DOCKER_HOST for Podman
63147 if : ${{ matrix.tool == 'podman' }}
64148 run : |
65- sudo apt update
66- sudo apt install -y podman podman-docker
67- curl -LO https://github.com/docker/compose/releases/download/v2.40.0/docker-compose-linux-x86_64
68- chmod +x docker-compose-linux-x86_64
69- sudo mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
70149 sudo systemctl enable --now podman.socket
71150 systemctl --user enable --now podman.socket
151+ echo "DOCKER_HOST=unix://$(podman info --format '{{.Host.RemoteSocket.Path}}')" >> $GITHUB_ENV
72152
73- - name : Display versions
153+ - name : Display container engine version
74154 run : |
75155 echo "*** ${{ matrix.tool }} version ***"
76156 ${{ matrix.tool }} version
77157 echo
78158 echo "*** ${{ matrix.tool }} compose version ***"
79159 ${{ matrix.tool }} compose version
80160
81- - name : Configure DOCKER_HOST for Podman
82- if : ${{ matrix.tool == 'podman' }}
83- run : echo "DOCKER_HOST=unix://$(podman info --format '{{.Host.RemoteSocket.Path}}')" >> $GITHUB_ENV
161+ - name : ${{ matrix.tool }} info
162+ run : ${{ matrix.tool }} info
84163
85164 - name : Compose config
86165 run : ${{ matrix.tool }} compose ${{ matrix.composeConfig.cliArgs }} config
0 commit comments