jlandure / alpine-chrome

Chrome Headless docker images built upon alpine official image
https://hub.docker.com/r/zenika/alpine-chrome
Apache License 2.0
1.89k stars 245 forks source link

Added platform arg to docker build #182

Closed drpayyne closed 2 years ago

drpayyne commented 3 years ago

Hi @jlandure, thanks a lot for your work!

Here's my PR to open discussion for publishing multi-arch images:

https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/ has a quick guide on what I propose. The docker buildx way. I have been testing this out and using this extensively to publish multi-arch image to multiple registries.

Suggestion - what about using GitHub Actions to publish multi-arch multi-registry images? Here's my repo which implements it this way - https://github.com/drpayyne/docker-php. There's a single workflow file for each package and I build for both linux/arm64 and linux/amd64 and publish it to both DockerHub and GitHub Packages.

This is a draft PR which I intend to take forward in your preferred way of action. Please let me know how we can do this. From a quick overview, only the Deno Dockerfile needs a little modification to get it to work multi-platform. We need to pick the appropriate Deno download URL based on the target architecture. A preview of how it would be is implemented by me for another repo at https://github.com/markshust/docker-magento/pull/516/files

Ferror commented 2 years ago

Go ahead and use mine pipeline.


name: Build & Publish Docker Image

on:
    push:

jobs:
    build:
        runs-on: ubuntu-latest
        steps:
            -
                name: checkout code
                uses: actions/checkout@v2
            -
                name: Login to Docker Hub
                uses: docker/login-action@v1
                with:
                    username: ${{ secrets.DOCKER_HUB_USERNAME }}
                    password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
            -
                name: install buildx
                id: buildx
                uses: crazy-max/ghaction-docker-buildx@v1
                with:
                    buildx-version: latest
            -
                name: build the image
                run: |
                    docker buildx build \
                        --push \
                        --tag ${{ secrets.DOCKER_HUB_USERNAME }}/REPO-NAME:TAG \
                        --platform linux/amd64,linux/arm/v7,linux/arm64 .
jlandure commented 2 years ago

Hi there 👋

I am investigating your proposal and buildx I will publish new images soon. 😊 And sorry for the delay.

Ferror commented 2 years ago

@jlandure any updates regarding linux/arm64 image?

hgwood commented 2 years ago

Hi @drpayyne! Your change has been included in #201. Thank you very much.

drpayyne commented 2 years ago

Thank you @hgwood and @zigarn! Apologies that I missed the PR comment notification.