open-horizon / examples

Code examples you can use with Horizon.
Apache License 2.0
40 stars 65 forks source link

Replace deprecated aarch64/alpine container #559

Closed mpeiffer closed 1 year ago

mpeiffer commented 1 year ago

Summary of Changes

Replaced the aarch64/alpine container with the arm64v8/alpine container. Addresses issue #558.

Testing

dockerbuild

Notes

I was having some issues with the tag for the make build command, so I checked the Makefile and just ran that command with a different tag instead. issue

joewxboy commented 1 year ago

@johnwalicki and @t-fine Could you please review?

johnwalicki commented 1 year ago

I would do this completely differently. All of the examples/ repos have Dockerfile.amd64 / Dockerfile.arm / Dockerfile.arm64
I did a meld on these gps Dockerfiles and they are slightly different. (which is not good) These three Dockerfiles and differences are unnecessary. We could delete them all. Create one common Dockerfile Just use FROM golang:1.19-alpine for all of them.
Then in the Makefile, tell the docker build --platform linux/$(ARCH) Docker/Podman will figure out which arch image to pull and build.

build:
    @docker build --platform linux/arm64 -t $(CONTAINER_IMAGE_BASE)_arm64:$(CONTAINER_IMAGE_VERSION) -f ./Dockerfile
    @docker build --platform linux/amd64 -t $(CONTAINER_IMAGE_BASE)_amd64:$(CONTAINER_IMAGE_VERSION) -f ./Dockerfile
johnwalicki commented 1 year ago

To show how this can be done, I submitted a PR over in the helloworld example. https://github.com/open-horizon/examples/pull/561

johnwalicki commented 1 year ago

I suggest we close this PR and use the technique suggested in #561 That would solve the aarch64/alpine issue but have the added benefit of converging on one common Dockerfile for all the archs.

johnwalicki commented 1 year ago

@mpeiffer Can you give the #560 technique a try instead? Also, in your new PR, please remember to sign your commits so that the DCO check will pass.

mpeiffer commented 1 year ago

Thank you for the review. I will update with the suggested changes as soon as I can.