Skip to content

Commit

Permalink
Exclude docker-stack-await image from docker prune
Browse files Browse the repository at this point in the history
The image gets cleaned away after each run, which causes a lot of unnecessary pulls.
  • Loading branch information
andyundso committed Apr 30, 2024
1 parent 946cacb commit 1a782fe
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ jobs:
mkdir -p ~/.ssh
ssh-keyscan -t rsa -p 2222 127.0.0.1 >> ~/.ssh/known_hosts
- name: Run a container to verify that docker system prune will work
run: |
ssh -p 2222 [email protected] docker run --name debian debian:12
shell: bash

- name: Test
uses: ./action
with:
Expand All @@ -61,3 +66,24 @@ jobs:
exit 1
fi
shell: bash

- name: Check that docker-stack-wait image is still there
run: |
ssh -p 2222 [email protected] docker image inspect sudobmitch/docker-stack-wait:v0.2.5
shell: bash

- name: Check that the Debian container got removed
run: |
if ssh -p 2222 [email protected] docker container inspect debian; then
echo "Debian container was not cleaned up!"
exit 1
fi
shell: bash

- name: Check that the Debian image got removed
run: |
if ssh -p 2222 [email protected] docker image inspect debian:12; then
echo "Debian image was not cleaned up!"
exit 1
fi
shell: bash
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ runs:

- name: Cleaning up
run: |
docker system prune -af
docker system prune -af --filter 'label!=org.opencontainers.image.source=git://github.com/sudo-bmitch/docker-stack-wait.git' --filter 'label!=org.opencontainers.image.version=v0.2.5'
docker context remove --force target
shell: bash

Expand Down

0 comments on commit 1a782fe

Please sign in to comment.