Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: build and push image #3487

Open
wants to merge 1 commit into
base: 6.x
Choose a base branch
from

Conversation

alexislefebvre
Copy link
Contributor

@alexislefebvre alexislefebvre commented Feb 14, 2023

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.

⚠️ 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:

  1. workflow: https://github.com/alexislefebvre/deployer/actions/runs/4179168257/jobs/7238799360 (it will expire at some point)
  2. resulting image: https://github.com/alexislefebvre/deployer/pkgs/container/deployer
  3. 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>]

[…]

@antonmedv
Copy link
Member

Awesome cool. Will review and if not merge definitely take an inspiration from it)

@ochorocho
Copy link
Contributor

FYI, this will build multiarch images for different php/deployer version combinations:

@alexislefebvre
Copy link
Contributor Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants