@@ -157,92 +157,10 @@ jobs:
157157
158158 # region Podman setup
159159
160- # https://github.com/containers/buildah/issues/2521#issuecomment-884779112
161- - name : Workaround https://github.com/containers/podman/issues/22152#issuecomment-2027705598
162- run : sudo apt-get -qq remove podman crun
163-
164- - uses : actions/cache@v4
165- # https://docs.github.com/en/actions/reference/variables-reference#default-environment-variables
166- # https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables
167- id : cached-linuxbrew
160+ - name : Install Podman
161+ uses : ' ./.github/actions/install-podman-action'
168162 with :
169- path : /home/linuxbrew/.linuxbrew
170- key : linuxbrew-${{ runner.os }}-${{ runner.arch }}
171-
172- - name : Install podman (linux/amd64, or qemu-user emulation)
173- if : contains(fromJSON('["linux/amd64", "linux/s390x", "linux/ppc64le"]'), inputs.platform) && steps.cached-linuxbrew.outputs.cache-hit != 'true'
174- run : |
175- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
176- /home/linuxbrew/.linuxbrew/bin/brew install podman
177-
178- # Warning: Your CPU architecture (arm64) is not supported. We only support
179- # x86_64 CPU architectures. You will be unable to use binary packages (bottles).
180- #
181- # This is a Tier 2 configuration:
182- # https://docs.brew.sh/Support-Tiers#tier-2
183- # Do not report any issues to Homebrew/* repositories!
184- # Read the above document instead before opening any issues or PRs.
185- - name : Install podman (linux/arm64)
186- if : inputs.platform == 'linux/arm64' && steps.cached-linuxbrew.outputs.cache-hit != 'true'
187- # Error: podman: no bottle available!
188- # If you're feeling brave, you can try to install from source with:
189- run : |
190- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
191- /home/linuxbrew/.linuxbrew/bin/brew install --build-from-source podman
192-
193- - name : Add linuxbrew to PATH
194- run : echo "/home/linuxbrew/.linuxbrew/bin/" >> $GITHUB_PATH
195-
196- - name : Configure Podman
197- run : |
198- set -Eeuxo pipefail
199-
200- # podman running as service ignores the TMPDIR env var here, let's give it a bind-mount to /var/tmp
201- mkdir -p $TMPDIR
202- sudo mount --bind -o rw,noexec,nosuid,nodev,bind $TMPDIR /var/tmp
203-
204- # podman from brew has its own /etc (was giving me Failed to obtain podman configuration: runroot must be set)
205- # the (default) config location is also where cri-o gets its storage defaults (that can be overriden in crio.conf)
206- sudo cp ci/cached-builds/containers.conf /etc/containers.conf
207- sudo cp ci/cached-builds/containers.conf /home/linuxbrew/.linuxbrew/opt/podman/etc/containers.conf
208- sudo cp ci/cached-builds/storage.conf /etc/containers/storage.conf
209- sudo cp ci/cached-builds/storage.conf /home/linuxbrew/.linuxbrew/opt/podman/etc/containers/storage.conf
210- sudo cp ci/cached-builds/registries.conf /etc/containers/registries.conf
211- sudo cp ci/cached-builds/registries.conf /home/linuxbrew/.linuxbrew/opt/podman/etc/containers/registries.conf
212-
213- # should reset storage when changing storage.conf
214- mkdir -p $HOME/.local/share/containers/storage/tmp
215- # remote (CONTAINER_HOST) podman does not do reset (and refuses --force option)
216- sudo /home/linuxbrew/.linuxbrew/opt/podman/bin/podman system reset --force
217-
218- # https://github.com/containers/podman/pull/25504
219- # podman 5.5.0: The podman system reset command no longer removes the user's podman.sock API socket
220- sudo rm -rf /var/run/podman
221-
222- # https://github.com/containers/podman/blob/main/docs/tutorials/socket_activation.md
223- # since `brew services start podman` is buggy, let's do our own brew-compatible service
224- # Regarding directory paths, see https://unix.stackexchange.com/questions/224992/where-do-i-put-my-systemd-unit-file
225- sudo mkdir -p /usr/local/lib/systemd/system/
226- sudo cp ci/cached-builds/podman.service /usr/local/lib/systemd/system/podman.service
227- sudo cp ci/cached-builds/podman.socket /usr/local/lib/systemd/system/podman.socket
228- sudo systemctl daemon-reload
229- sudo systemctl unmask --now podman.service podman.socket
230- sudo systemctl start podman.socket
231-
232- # needed (much) later for trivy
233- echo "PODMAN_SOCK=/var/run/podman/podman.sock" >> $GITHUB_ENV
234-
235- # quick check podman works
236- podman ps
237-
238- - name : Show error logs (on failure)
239- if : ${{ failure() }}
240- run : |
241- set -Eeuxo pipefail
242-
243- journalctl -xe
244- ls -AlF /var/run/podman/podman.sock || echo "Socket /var/run/podman/podman.sock not found"
245- sudo ss -xlpn | grep 'podman.sock' || echo "No active listener found for podman.sock via ss"
163+ platform : ${{ inputs.platform }}
246164
247165 - name : Calculate image name and tag
248166 id : calculated_vars
0 commit comments