docker-build-push
docker-build-push copied to clipboard
Add option to build only without push
It would be nice to have an option to just build an image to see if the Dockerfile is correct without pushing the result. For example with pull requests one would like to know if the proposed Dockerfile builds, but the resulting image should not be pushed to a docker repository. Please add an input of boolean type to control the pushing of the built image.
Hi @peterbandi - thanks for the feature request. I can consider adding a flag such as pushImage that would be set to true by default for backwards compatibility.
That would be perfect.
I agree to that.
I came here to ask for this same thing :)
Well then, I must give the people what they want! Will get started on this feature right away.
@peterbandi @scolastico @justinmchase - I have added this feature in a branch.
Can one of you please give this a try using the following workflow settings and let me know if it achieves the intended functionality?
uses: mr-smithers-excellent/docker-build-push@feat/push-flag
with:
image: [image]
pushImage: false # new optional input
registry: [registry]
username: [username]
password: ${{ secrets.DOCKER_PASSWORD }}
Do you need a registry/username/password if you're not going to push?
Also just a recommendation but maybe:
mode: 'build' # or 'build_and_push' (default)
@justinmchase - username/password no, registry is still prefixed to the image name currently.
Nice job, ty! 👍🏻
Also btw did you thought about changing the registry default value to ghcr.io? Because this is the most used value on gh.
pushImage: false
@mr-smithers-excellent Sorry for the late reply. We had a deadline. It works as intended. I can prevent image pushing with pushImage: false while the built image is pushed to the docker repository with pushImage: true or by leaving out the pushImage option.
Excellent! This feature is now available in the v5 and v5.8 releases.