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: ensure docker-compose platform is amd64 #990

Merged
merged 1 commit into from
Jan 28, 2024

Conversation

gavinbunney
Copy link
Contributor

When running build/test process on arm machines (M1 etc), the docker-compose setup attempts to run arm images. This in turn causes protoc to fail as the Dockerfile.protoc forces use of protoc-x86.

This PR updates the docker-compose.yml file to ensure amd64 platform base images are used when running.

Before:

$ yarn build:test
[+] Building 1.1s (10/11)                                                                                                                                                                                    docker:desktop-linux
 => [protoc internal] load build definition from protoc.Dockerfile                                                                                                                                                           0.0s
 => => transferring dockerfile: 570B                                                                                                                                                                                         0.0s
 => [protoc internal] load .dockerignore                                                                                                                                                                                     0.0s
 => => transferring context: 2B                                                                                                                                                                                              0.0s
 => [protoc internal] load metadata for docker.io/library/node:current-slim                                                                                                                                                  0.4s
 => [protoc 1/7] FROM docker.io/library/node:current-slim@sha256:e8a7eb273ef8a9ebc03f0ad03c0fd4bbc3562ec244691e6fc37344ee2c4357d2                                                                                            0.0s
 => [protoc] https://github.com/protocolbuffers/protobuf/releases/download/v3.19.1/protoc-3.19.1-linux-x86_64.zip                                                                                                            0.6s
 => CACHED [protoc 2/7] RUN apt-get update --yes && apt-get install --yes unzip                                                                                                                                              0.0s
 => CACHED [protoc 3/7] ADD https://github.com/protocolbuffers/protobuf/releases/download/v3.19.1/protoc-3.19.1-linux-x86_64.zip protoc.zip                                                                                  0.0s
 => CACHED [protoc 4/7] RUN mkdir /usr/local/lib/protoc && unzip protoc.zip -d /usr/local/lib/protoc && rm protoc.zip                                                                                                        0.0s
 => CACHED [protoc 5/7] RUN ln -s /usr/local/lib/protoc/bin/protoc /usr/local/bin/protoc                                                                                                                                     0.0s
 => ERROR [protoc 6/7] RUN protoc --version                                                                                                                                                                                  0.1s
------                                                                                                                                                                                                                            
 > [protoc 6/7] RUN protoc --version:
0.108 rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2
0.108  Trace/breakpoint trap
------
failed to solve: process "/bin/sh -c protoc --version" did not complete successfully: exit code: 133

After:

$ yarn build:test
[+] Building 11.9s (12/12) FINISHED

@gavinbunney gavinbunney changed the title Fix docker-compose platform to ensure x86 fix: ensure docker-compose platform is amd64 Jan 23, 2024
@stephenh
Copy link
Owner

This is great @gavinbunney , thank you!

@stephenh stephenh merged commit bdf4710 into stephenh:main Jan 28, 2024
6 of 7 checks passed
stephenh pushed a commit that referenced this pull request Jan 28, 2024
## [1.167.2](v1.167.1...v1.167.2) (2024-01-28)

### Bug Fixes

* ensure docker-compose platform is amd64 ([#990](#990)) ([bdf4710](bdf4710))
@stephenh
Copy link
Owner

🎉 This PR is included in version 1.167.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants