build-tools
build-tools copied to clipboard
Build multiarch docker images on tag
Updates the github workflow to use standard docker actions to build and publish multi-arch images when a git tag is pushed.
The workflow creates two tags, latest and one that is the git tag with the leading v stripped off. For example, the tag v1.2.3 would create an image with tags latest and 1.2.3.
- Closes #115
- Closes https://github.com/open-telemetry/opentelemetry-proto-go/issues/77
Okay, fixed the docker pathing issue. Now it's failing on installing protoc_gen_lint here - this runs fine locally for me.
Okay, so I've confirmed that the TARGETARCH build arg isn't getting set by the buildx command as expected - see here.
I'm working on a way to detect the target arch and set the arg another way.
This works when run and setting the build arg manually like this docker build protobuf/. -t build-tools --build-arg TARGETARCH=arm64.
Well, it looks like the problem was that the generic top level ARG default was overriding the ones passed in. After removing, it seems to have worked. However, the build is now super at more than 2 hours. This is likely because we're using QEMU and compiling our own grpc binaries.
Maybe we could source prebuilt binaries from somewhere else?
I'm not sure what we should do. Practically speaking, it's easy enough for me to find an amd64 machine to build with. 🤣
@MikeGoldsmith do you mean that the build time is 2 hours to build the docker images? That doesn't sound like a problem, and it would be great to get this merged.
I was mistaken, the grpc_objective_c_plugin also segfaults.
How to repeat the results quoted above:
In this branch, I ran:
docker build protobuf/. -t build-tools --build-arg TARGETARCH=arm64
docker tag build-tools:latest build-tools:multiarch
Then, in an otel-proto repository:
make OTEL_DOCKER_PROTOBUF=build-tools:multiarch
I was about to open a similar PR (didn't notice this one)...is anybody still working on this one?