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

Build images with single file in push_docker_image workflow #2609

Closed
moreal opened this issue Oct 24, 2024 · 2 comments · Fixed by #2614
Closed

Build images with single file in push_docker_image workflow #2609

moreal opened this issue Oct 24, 2024 · 2 comments · Fixed by #2614
Assignees
Labels
bug Something isn't working ci good first issue Good for newcomers hacktoberfest Issues or pull requests for Hacktoberfest event

Comments

@moreal
Copy link
Contributor

moreal commented Oct 24, 2024

Overview

Please make push_docker_image to build linux/arm64 and linux/amd64 image with single dockerfile.

The following links will be helpful when working on this issue:

🙌🏻 Context

Now, there are Dockerfile.amd64 and Dockerfile.arm64v8 files to build for each platforms.

- name: build-and-push-amd64
run: |
docker build . \
-f ${{ matrix.docker.dockerfile }}.amd64 \
-t ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 \
--build-arg COMMIT=git-${{ github.sha }} \
--build-arg TARGETPLATFORM=linux/amd64
docker push ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64
- name: build-and-push-arm64v8
run: |
docker build . \
-f ${{ matrix.docker.dockerfile }}.arm64v8 \
-t ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8 \
--build-arg COMMIT=git-${{ github.sha }} \
--build-arg TARGETPLATFORM=linux/arm64
docker push ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8

But there are no difference between two dockerfiles and docker buildx build --platforms linux/amd64,linux/arm64 command can the two platforms at once.

# https://github.com/planetarium/mimir/blob/2ce505fb86f0dac98ffed16d30581371555a85e3/.github/workflows/docker.yaml
-
  name: Set up Docker Buildx
  uses: docker/setup-buildx-action@v3
  with:
    platforms: linux/arm/v8,linux/amd64
-
  name: Build and push
  uses: docker/build-push-action@v5
  with:
    push: ${{ github.event_name != 'pull_request' }}
    platforms: linux/arm64,linux/amd64
    tags: ${{ matrix.docker.repo }}:git-${{ github.sha }}
    file: ${{ matrix.docker.dockerfile }}

Since #2599, Dockerfile and Dockerfile.Acc are now able to build both linux/arm64 and linux/amd64. But I missed to make the push_docker_image workflow to build images with the Dockerfile and Dockerfile.Acc file.

So this issue suggests to fix the missed work.

@moreal moreal added bug Something isn't working ci labels Oct 24, 2024
@riemannulus riemannulus added hacktoberfest Issues or pull requests for Hacktoberfest event good first issue Good for newcomers labels Oct 27, 2024
@Gongkirby
Copy link
Contributor

제가 해보겠습니다!

@riemannulus
Copy link
Member

#2610 should be the next step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci good first issue Good for newcomers hacktoberfest Issues or pull requests for Hacktoberfest event
Projects
Development

Successfully merging a pull request may close this issue.

3 participants