mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-12-22 13:06:11 +01:00

[BUGFIX] Ensure removing dangling images works with podman (#1090)

The TYPO3 core `runTests.sh` contains the `-u` option to
update the images and remove dangling images. Providing
an image name and a `--filter` option is not supported
by podmand and has not been discovered yet in the TYPO3
core implementation yet - and adopted with the recently
sync of this repository implementation to the TYPO3 one.

Both supported docker binaries `docker` and `podman`
supportes filtering images using the `reference` filter
option. Therefore, this change modifies the dangling
image remove command to use double filter options.

To verify that double filtering can be used, following
command can be executed if already some images have
been downloaded:

```shell
podman images \
	--filter "reference=ghcr.io/sbuerk/demo-core-testing-*"
	--filter "dangling=false" --format "{{.ID}}"

docker images \
        --filter "reference=ghcr.io/sbuerk/demo-core-testing-*"
        --filter "dangling=false" --format "{{.ID}}"
```

**Note:**	`dangling=false` is used here instead of
		`dangling=true` like in `runTests.sh`

Resolves: #1088
This commit is contained in:
Stefan Bürk 2023-12-19 10:44:53 +01:00 committed by GitHub
parent 7f8f379fea
commit 16aee3c836
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -617,7 +617,7 @@ case ${TEST_SUITE} in
echo ""
# remove "dangling" typo3/core-testing-* images (those tagged as <none>)
echo "> remove \"dangling\" ghcr.io/sbuerk/demo-core-testing-* images (those tagged as <none>)"
${CONTAINER_BIN} images ghcr.io/sbuerk/demo-core-testing-* --filter "dangling=true" --format "{{.ID}}" | xargs -I {} ${CONTAINER_BIN} rmi {}
${CONTAINER_BIN} images --filter "reference=ghcr.io/sbuerk/demo-core-testing-*" --filter "dangling=true" --format "{{.ID}}" | xargs -I {} ${CONTAINER_BIN} rmi {}
echo ""
;;
*)