-
Notifications
You must be signed in to change notification settings - Fork 55
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
Conversation
@strider2038 @lucasantarella can you may have a look at this PR? Thanks in advance :-) |
Could you merge this, please. |
+1 Merge please |
Now it fails on go build https://github.com/muonsoft/openapi-mock/actions/runs/3575788220/jobs/6012771527 |
The Dockerfile is not ready for multiarch. GOARCH is set to amd64 needs to be changed to target platform |
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.... |
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>
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>
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>
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.