Skip to content

Commit 1a782fe

Browse files
committed
Exclude docker-stack-await image from docker prune
The image gets cleaned away after each run, which causes a lot of unnecessary pulls.
1 parent 946cacb commit 1a782fe

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ jobs:
3737
mkdir -p ~/.ssh
3838
ssh-keyscan -t rsa -p 2222 127.0.0.1 >> ~/.ssh/known_hosts
3939
40+
- name: Run a container to verify that docker system prune will work
41+
run: |
42+
ssh -p 2222 [email protected] docker run --name debian debian:12
43+
shell: bash
44+
4045
- name: Test
4146
uses: ./action
4247
with:
@@ -61,3 +66,24 @@ jobs:
6166
exit 1
6267
fi
6368
shell: bash
69+
70+
- name: Check that docker-stack-wait image is still there
71+
run: |
72+
ssh -p 2222 [email protected] docker image inspect sudobmitch/docker-stack-wait:v0.2.5
73+
shell: bash
74+
75+
- name: Check that the Debian container got removed
76+
run: |
77+
if ssh -p 2222 [email protected] docker container inspect debian; then
78+
echo "Debian container was not cleaned up!"
79+
exit 1
80+
fi
81+
shell: bash
82+
83+
- name: Check that the Debian image got removed
84+
run: |
85+
if ssh -p 2222 [email protected] docker image inspect debian:12; then
86+
echo "Debian image was not cleaned up!"
87+
exit 1
88+
fi
89+
shell: bash

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ runs:
9191

9292
- name: Cleaning up
9393
run: |
94-
docker system prune -af
94+
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'
9595
docker context remove --force target
9696
shell: bash
9797

0 commit comments

Comments
 (0)