Closed sparr closed 1 year ago
I think one possible solution is tagging our images with something like 'soci_test'. This way soci integ tests wont share any images with users. Using all
or local
flag should still remove the images used by the services.
Describe the bug The final step of the integration tests is to tear down the docker compose environment. This will fail if a container from a different docker compose environment uses an image that this teardown tries to remove.
Steps To Reproduce
confFile
as follows:docker-compose -f confFile up &
GO_TEST_FLAGS="-run SnapshotterStartup -count=1" make integration
(specific test isn't important)Cleanup after reproduction
fg
docker-compose -f confFile down --rmi all
rm confFile
Expected behavior Integration test run succeeds.
Configuration (please complete the following information):
Additional context The failing step is
exec.Command("docker-compose", "-f", confFile, "down", "--rmi", "all").Run()
which produces this outputError response from daemon: conflict: unable to remove repository reference "[ghcr.io/oci-playground/registry:v3.0.0-alpha.1](http://ghcr.io/oci-playground/registry:v3.0.0-alpha.1)" (must force) - container fcca3f99c8a6 is using its referenced image bf427d5377cc
then exits with status 1. That output is due to the other compose environment having a running container using an image that thisdocker-compose down --rmi all
wants to remove.