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

Can't build 5.0 image on M1 Mac #465

Closed
aterreno opened this issue Jun 15, 2021 · 8 comments
Closed

Can't build 5.0 image on M1 Mac #465

aterreno opened this issue Jun 15, 2021 · 8 comments

Comments

@aterreno
Copy link

Hi, this issue #439 needs reopening, or rather, it was misunderstood. I can't build the 5.0 image locally (on a mac m1, if that matters)

 => ERROR [tools  3/13] RUN set -ex     && wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -     && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/s  2.2s
------
 > [tools  3/13] RUN set -ex     && wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -     && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google.list     && apt-get update     && apt-get install -y google-chrome-stable     && google-chrome --version:
#9 0.286 + wget -q -O - https://dl.google.com/linux/linux_signing_key.pub
#9 0.286 + apt-key add -
#9 0.327 Warning: apt-key output should not be parsed (stdout is not a terminal)
#9 0.664 OK
#9 0.668 + echo deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
#9 0.668 + tee /etc/apt/sources.list.d/google.list
#9 0.669 deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
#9 0.669 + apt-get update
#9 0.891 Hit:1 http://archive.canonical.com/ubuntu focal InRelease
#9 0.912 Hit:2 http://ports.ubuntu.com/ubuntu-ports focal InRelease
#9 0.955 Hit:3 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease
#9 1.012 Hit:4 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
#9 1.030 Get:5 http://dl.google.com/linux/chrome/deb stable InRelease [1811 B]
#9 1.145 Hit:6 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
#9 1.221 Get:7 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1101 B]
#9 1.241 Hit:8 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
#9 1.302 Fetched 2912 B in 1s (4879 B/s)
#9 1.302 Reading package lists...
#9 1.692 + apt-get install -y google-chrome-stable
#9 1.716 Reading package lists...
#9 2.076 Building dependency tree...
#9 2.152 Reading state information...
#9 2.201 E: Unable to locate package google-chrome-stable
------
executor failed running [/bin/sh -c set -ex     && wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -     && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google.list     && apt-get update     && apt-get install -y google-chrome-stable     && google-chrome --version]: exit code: 100

If I comment out the google-chrome bit on the dockerfile everything is fine.

@aterreno
Copy link
Author

I see now progressing the install I get this

#11 52.97
#11 52.97 2021-06-15 14:40:33 (593 KB/s) - ‘amazon-ssm-agent.deb’ saved [31597536/31597536]
#11 52.97
#11 52.98 + dpkg -i amazon-ssm-agent.deb
#11 53.03 dpkg: error processing archive amazon-ssm-agent.deb (--install):
#11 53.03  package architecture (amd64) does not match system (arm64)
#11 53.04 Errors were encountered while processing:
#11 53.04  amazon-ssm-agent.deb
------
executor failed running [/bin/sh -c set -ex     && mkdir /tmp/ssm     && cd /tmp/ssm     && wget https://s3.amazonaws.com/amazon-ssm-us-east-1/2.3.1644.0/debian_amd64/amazon-ssm-agent.deb     && dpkg -i amazon-ssm-agent.deb]: exit code: 1

so perhaps the issue is really my M1 architecture, but it's not clear from the previous error output?

I'll try to build on Linux, no big deal

@aterreno aterreno changed the title Can't build 5.0 image Can't build 5.0 image on M1 Mac Jun 15, 2021
@josephvusich
Copy link
Contributor

You may be able to build it using the platform flag, e.g.: --platform linux/amd64

@aterreno
Copy link
Author

aterreno commented Jul 9, 2021

Thanks but if I do that I won't be able to run them on my mac right, which was the whole point of this exercise.

I am sort of giving up on using docker on mac M1 right now, it adds too much complexity to my workflow.

I started using https://bigdevbox.com/ and I can build there docker on the target architecture without too much hassle.

Thanks for your help

@josephvusich
Copy link
Contributor

Thanks but if I do that I won't be able to run them on my mac right

Docker on Mac uses the Apple Hypervisor Framework, and is capable of both building and running cross-platform images: https://docs.docker.com/docker-for-mac/apple-silicon/

@mepc36
Copy link

mepc36 commented Apr 11, 2022

--platform linux/amd64

Adding this flag and running the following made me build successfully, thanks @josephvusich :

docker build -t aws/codebuild/standard:5.0 . --platform linux/amd64

@deshruch
Copy link

Running this on M1
docker build -t aws/codebuild/standard:5.0 . --platform linux/amd64

Been running for 5+ hours.
Any update on this issue?

@deshruch
Copy link

Stuck at this stage when left to run on the weekend:
image

@subinataws
Copy link
Contributor

Moving all Mac build failures reported to one issue: #575.

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

No branches or pull requests

5 participants