Skip to content

Commit

Permalink
fix: Replace newline with spaces to find docker resources to remove (q…
Browse files Browse the repository at this point in the history
…drant#4215)

* fix: Replace newline with spaces to find docker resources to remove

* fix: Use xargs instead of tr

* fix: Avoid quotes to pass multiple args

* fix: Use tr -d
  • Loading branch information
KShivendu authored and generall committed May 26, 2024
1 parent 49e23ce commit 3fffffb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/dev-docker-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:
ref: ${{ github.ref.name }}
- name: Build the Docker image
run: |
buildx_containers=$(docker container ls -a -qf "name=buildx_buildkit")
buildx_volumes=$(docker volume ls -qf "name=buildx_buildkit")
buildx_containers=$(docker container ls -a -qf "name=buildx_buildkit" | tr -d '\n')
buildx_volumes=$(docker volume ls -qf "name=buildx_buildkit" | tr -d '\n')
if [ -n "$buildx_containers" ]; then
echo "Buildx containers to delete: " "$buildx_containers"
docker container rm -f "$buildx_containers"
echo "Buildx containers to delete: $buildx_containers"
docker container rm -f $buildx_containers
fi
if [ -n "$buildx_volumes" ]; then
echo "Buildx volumes to delete: " "$buildx_volumes"
docker volume rm -f "$buildx_volumes"
echo "Buildx volumes to delete: $buildx_volumes"
docker volume rm -f $buildx_volumes
fi
branch=${GITHUB_REF_NAME//\//-} # replace all / with -
Expand Down

0 comments on commit 3fffffb

Please sign in to comment.