Skip to content

Commit

Permalink
Improve builder with prune
Browse files Browse the repository at this point in the history
  • Loading branch information
rbonghi committed Nov 16, 2021
1 parent 6c24e5b commit 852f581
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
needs: [docker]
runs-on: ubuntu-latest
steps:
# https://github.community/t/how-to-get-just-the-tag-name/16241/11
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
Expand Down
5 changes: 5 additions & 0 deletions nanosaur_perception/scripts/docker_builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ main()

echo "- Build repo ${green}$REPO_NAME:$TAG${reset}"
docker build $NO_CACHE -t $REPO_NAME:$TAG --build-arg "DPKG_STATUS=$DPKG_STATUS" .

if $CI_BUILD ; then
echo "- ${bold}Prune${reset} old docker images"
docker image prune -f
fi
else
echo "- Push repo ${green}$REPO_NAME:$TAG${reset}"
docker image push $REPO_NAME:$TAG
Expand Down

0 comments on commit 852f581

Please sign in to comment.