Skip to content

Commit

Permalink
added multi architecture build and push in 1 runner (simple to do, bu…
Browse files Browse the repository at this point in the history
…t time consuming)
  • Loading branch information
grasdk committed Apr 23, 2024
1 parent 7b5d847 commit 5df3989
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/docker-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/[email protected]
with:
Expand All @@ -38,6 +44,7 @@ jobs:
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,12 @@ Although it's possible to build packages without `dockerd` running, using [`buil
2. Run the build command: `docker buildx build -t galette-local .`
* replace `galette-local` with any name you would like to give your local image

### Building for multiple architecures locally
1. Start the docker daemon if it's not already started: `sudo dockerd`
2. Create a builder-image `docker buildx create --name mybuilder --use --bootstrap` (see "Building with Buildx" [here](https://www.docker.com/blog/how-to-rapidly-build-multi-architecture-images-with-buildx/) for more details)
3. Run the build command: `docker buildx build --platform linux/amd64,linux/arm64 -t galette-local .`
* replace `galette-local` with any name you would like to give your local image
* NOTE: The build process is significantly longer than just building for your local architecture.

## Running the docker image locally
1. Follow the same steps as in [How to use this image](./README.md#How-to-use-this-image), replacing the image name `galette/galette:latest` with your local container name, e.g. `galette-local`.

0 comments on commit 5df3989

Please sign in to comment.