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 buildx bake - The Sequel #133

Closed
wants to merge 7 commits into from

Conversation

back-2-95
Copy link
Contributor

@back-2-95 back-2-95 commented Jan 14, 2023

TODO / TBD

  • Add Docker Hub log into GHA workflow and enable push
  • Builder dockerfiles can be also combines into one multistage dockerfile

Notes

  • Uses named build contexts introduced in buildx 0.8.0 - No more ARGS

Testing

Show what is about to go down:

docker buildx bake -f docker-bake.hcl --print

Build all images locally for arm64 arch (with --load and --set "*.platform=linux/arm64" flags):

docker buildx bake -f docker-bake.hcl --pull --load --set "*.platform=linux/arm64"

Same as previous but build only 1 target from docker-bake.hcl:

docker buildx bake -f docker-bake.hcl --pull --load --set "*.platform=linux/arm64" bullseye

Build locally and override image name:

IMAGE_NAME=my/frankenphp docker buildx bake -f docker-bake.hcl --pull --load --set "*.platform=linux/arm64" --progress plain

Build and push all images with override image name (needs you logged in to Docker Hub or some other registry):

IMAGE_NAME=my/frankenphp docker buildx bake -f docker-bake.hcl --pull --push

- name: Run tests
run: |
docker load -i /tmp/.builder.tar
docker run --rm frankenphp:${{ github.sha }}-builder "go test -a -v"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to continue running the tests somewhere in the CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is just that I need help with this one.

builder-bullseye.Dockerfile Outdated Show resolved Hide resolved
WORKDIR /go/src/app

COPY go.mod go.sum ./
RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment explaining why it's necessary please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate file or what?

Copy link
Owner

@dunglas dunglas Feb 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what it's doing :D

@dunglas
Copy link
Owner

dunglas commented Feb 27, 2023

@back-2-95 I would really like to get this PR merged! Is there anything I can do to help?

@dunglas
Copy link
Owner

dunglas commented Feb 27, 2023

I rebased your branch and fixed and issue with the Dockerfile versions.

@dunglas dunglas closed this in #163 Jul 17, 2023
@back-2-95 back-2-95 deleted the docker-bake-the-sequel branch July 19, 2023 09:17
This pull request was closed.
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.

2 participants