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

build: Support arm64 container and add containerized build target #136

Merged
merged 4 commits into from
Dec 18, 2020

Conversation

pingleig
Copy link
Member

@pingleig pingleig commented Dec 8, 2020

Description of the issue

The Dockerfile is hard coded to use amd64 binary, we should determine it at runtime or let build context specify it.

Description of changes

  • Use TARGETARCH arg from docker buildx or fallback to dpkg --print-architecture
  • Add two new Dockerfiles to build from local deb file or the source code
  • Change base builder image from Debian to Ubuntu because there is no official release for Debian arm64

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

cd amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile
docker build .
# make sure you have access to go mod proxy,  some organization block it in corp network
make dockerized-build
# If you have the repo with vendor folder,  run the following instead, go mod proxy access is not required
make dockerized-build-vendor

For multi arch build, make sure you have docker buildx, you need to use the edge version instead of the stable one.

cd amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile
docker buildx create --name multi-builder
docker buildx use multi-builder
docker buildx build --platform linux/amd64,linux/arm64 .

* For aws#114 user no longer need to write their own Dockerfile and it
works with `docker buildx`
* Add containerized build for developer w/o a local go environment
@pingleig pingleig added arch/arm64 ARM 64 bit area/build Build and release binary/docker image size/m Medium size issue/PR area/container Docker Container labels Dec 8, 2020
@pingleig pingleig requested review from yimuniao and hdj630 December 10, 2020 22:04
@pingleig pingleig requested a review from pxaws December 17, 2020 21:37
@pingleig pingleig merged commit 53596a5 into aws:master Dec 18, 2020
sky333999 pushed a commit that referenced this pull request Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch/arm64 ARM 64 bit area/build Build and release binary/docker image area/container Docker Container size/m Medium size issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants