deployer
deployer copied to clipboard
docker: build and push image
- [x] Bug fix #3118
- [x] New feature?
- [ ] BC breaks?
- [ ] Docs added?
I target 6.x so that 6.x and 7.x (later) could have Docker releases.
I tested it in another project: I created a 0.0.3 tag here https://github.com/alexislefebvre/docker-images/tree/0.0.3 GitHub Actions built an image and pushed it there: https://github.com/alexislefebvre/docker-images/pkgs/container/php-8.1-jakzal-phpqa-gd
Once this will work, people will be able to run something like docker run ghcr.io/deployphp/deployer:v6.9.1 dep
, use the image on their CI system, etc.
:warning: I don't know if it may allow a contributor to push bad code to a Docker image, sorry.
If you merge it and create a tag, it may fail if the registry is not active yet, IIRC we had the issue too and we had to change the visibility of our GitHub registry to private to public before we could push images.
To test the image: checkout this branch and run docker build
:
docker build . --tag deployer --build-arg VERSION=v6.9.1
docker run deployer
Real test on my fork:
- workflow: https://github.com/alexislefebvre/deployer/actions/runs/4179168257/jobs/7238799360 (it will expire at some point)
- resulting image: https://github.com/alexislefebvre/deployer/pkgs/container/deployer
- it works!
$ docker run -t --rm ghcr.io/alexislefebvre/deployer:v6.9.3 help
Description:
Display help for a command
Usage:
help [options] [--] [<command_name>]
[…]
Awesome cool. Will review and if not merge definitely take an inspiration from it)
FYI, this will build multiarch images for different php/deployer version combinations:
- https://github.com/ochorocho/deployer/blob/main/Dockerfile
- https://github.com/ochorocho/deployer/blob/main/.github/workflows/build.yml
@antonmedv Could you please check this PR?
@ochorocho Thanks for sharing it, I think we can merge this PR as is then add support of other architectures in another PR.