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

fix docker multi-arch build and push to DockerHub #80

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

smoench
Copy link
Contributor

@smoench smoench commented Nov 15, 2022

Hey 👋 ,
I saw there is a failing build and push of the docker image to DockerHub.
In the recent version 3 of the docker/build-push-action the configuration changed a bit.
I updated the workflow to work with latest version and as it is proposed here.
I couldn't test it but I'm using a similar configuration to build and push my docker multi-arch images to DockerHub.

@smoench smoench changed the title fix docker multi-arch build and pushing to DockerHub fix docker multi-arch build and push to DockerHub Nov 15, 2022
@smoench
Copy link
Contributor Author

smoench commented Nov 28, 2022

@strider2038 @lucasantarella can you may have a look at this PR? Thanks in advance :-)

@mbana
Copy link

mbana commented Nov 28, 2022

Could you merge this, please.

@kylehodgetts
Copy link
Contributor

+1 Merge please

@strider2038 strider2038 merged commit a043e5b into muonsoft:master Nov 29, 2022
@strider2038
Copy link
Collaborator

@smoench
Copy link
Contributor Author

smoench commented Nov 29, 2022

The Dockerfile is not ready for multiarch. GOARCH is set to amd64 needs to be changed to target platform

@gschafra
Copy link

Possible solution (see https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/#949e):

FROM --platform=$BUILDPLATFORM golang:alpine AS build-env
....
ARG TARGETOS TARGETARCH
RUN ...
&& CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="-w -s -X main.version=${APP_VERSION} -X main.buildTime=${BUILD_TIME}" -o openapi-mock \
....

If I get the chance, I will provide a PR....

mbana added a commit to kubeshop/kusk-gateway that referenced this pull request Dec 6, 2022
Summary
=======

1. Upgrade `muonsoft/openapi-mock` image to `0.3.8` so that `linux/arm64` is supported.
2. Change to fully qualified image name `docker.io/muonsoft/openapi-mock`.
3. Upgrade `github.com/getkin/kin-openapi` to `v0.110.0`.

Changes
=======

`go.mod` and `go.sum`
---------------------

Upgrade `github.com/getkin/kin-openapi` to `v0.110.0`.

`cmd/kusk/internal/mocking/server/server.go`
--------------------------------------------

Upgrade `muonsoft/openapi-mock` image to `0.3.8` that supports:

* `linux/amd64`
* `linux/arm64`

See https://hub.docker.com/layers/muonsoft/openapi-mock/0.3.8/images/sha256-63b97f13af19dc164d2e005be28224152c05187f7a523fee971b6c44f6316f9b?context=explore and [1].

References
==========

[1]: muonsoft/openapi-mock#80.

---

Signed-off-by: Mohamed Bana <mohamed@bana.io>
mbana added a commit to kubeshop/kusk-gateway that referenced this pull request Dec 6, 2022
Summary
=======

1. Upgrade `muonsoft/openapi-mock` image to `0.3.8` so that `linux/arm64` is supported.
2. Change to fully qualified image name `docker.io/muonsoft/openapi-mock`.
3. Upgrade `github.com/getkin/kin-openapi` to `v0.110.0`.

Changes
=======

`go.mod` and `go.sum`
---------------------

Upgrade `github.com/getkin/kin-openapi` to `v0.110.0`, and also ran `go mod tidy`.

`cmd/kusk/internal/mocking/server/server.go`
--------------------------------------------

Upgrade `muonsoft/openapi-mock` image to `0.3.8` that supports:

* `linux/amd64`
* `linux/arm64`

See https://hub.docker.com/layers/muonsoft/openapi-mock/0.3.8/images/sha256-63b97f13af19dc164d2e005be28224152c05187f7a523fee971b6c44f6316f9b?context=explore and [1].

References
==========

[1]: muonsoft/openapi-mock#80.

---

Signed-off-by: Mohamed Bana <mohamed@bana.io>
mbana added a commit to kubeshop/kusk-gateway that referenced this pull request Dec 6, 2022
Summary
=======

1. Upgrade `muonsoft/openapi-mock` image to `0.3.8` so that `linux/arm64` is supported.
2. Change to fully qualified image name `docker.io/muonsoft/openapi-mock`.
3. Upgrade `github.com/getkin/kin-openapi` to `v0.110.0`.

Changes
=======

`go.mod` and `go.sum`
---------------------

Upgrade `github.com/getkin/kin-openapi` to `v0.110.0`, and also ran `go mod tidy`.

`cmd/kusk/internal/mocking/server/server.go`
--------------------------------------------

Upgrade `muonsoft/openapi-mock` image to `0.3.8` that supports:

* `linux/amd64`
* `linux/arm64`

See https://hub.docker.com/layers/muonsoft/openapi-mock/0.3.8/images/sha256-63b97f13af19dc164d2e005be28224152c05187f7a523fee971b6c44f6316f9b?context=explore and [1].

References
==========

[1]: muonsoft/openapi-mock#80.

---

Signed-off-by: Mohamed Bana <mohamed@bana.io>
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.

5 participants