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

[Merged by Bors] - add a github action for build multi-arch docker images #1574

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: docker

on:
push:
branches:
- master

jobs:
build-docker-image:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master

- name: Dockerhub login
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: |
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin

- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
Copy link
Member

Choose a reason for hiding this comment

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

Do you think it's possible to avoid this external dep and build buildx like below?

$ git clone git://github.com/docker/buildx && cd buildx
$ make install

Copy link
Member Author

Choose a reason for hiding this comment

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

There were a couple extra steps, but think I have it now. I'm running it locally, so it'll take some time to finish, but looks like it's working.

Copy link
Member Author

Choose a reason for hiding this comment

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

This worked for me locally, is there a way to test it out on your Github server before merging?

Copy link
Member

Choose a reason for hiding this comment

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

There were a couple extra steps, but think I have it now. I'm running it locally, so it'll take some time to finish, but looks like it's working.

Nice! I'm not sure how to test it on our server, but if it works on yours then I assume it'll work on ours. I might just merge it and give it a go! :)

with:
buildx-version: latest

- name: Build dockerfile (with push)
run: |
docker buildx build \
--platform=linux/amd64,linux/arm64 \
--output "type=image,push=true" \
--file ./Dockerfile . \
--tag sigp/lighthouse:latest