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

Add support for linux/arm64 #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 34 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,35 @@ jobs:
- checkout
- run: make build
- run:
name: Archive Docker image
command: docker save -o image.tar contentful-labs/coredns-nodecache
name: Archive Docker images
command: |
docker save -o image-amd64.tar contentful-labs/coredns-nodecache-amd64
docker save -o image-arm64.tar contentful-labs/coredns-nodecache-arm64
- persist_to_workspace:
root: .
paths:
- ./image.tar
- ./image-amd64.tar
- ./image-arm64.tar
publish-branch:
executor: docker-publisher
steps:
- attach_workspace:
at: /tmp/workspace
- run:
name: Load archived Docker image
command: docker load -i /tmp/workspace/image.tar
name: Load archived Docker images
command: |
docker load -i /tmp/workspace/image-amd64.tar
docker load -i /tmp/workspace/image-arm64.tar
- run:
name: publish docker image with branch
name: publish docker images with branch
command: |
docker tag contentful-labs/coredns-nodecache:latest $IMAGE_NAME:$CIRCLE_BRANCH
docker tag contentful-labs/coredns-nodecache-amd64:latest $IMAGE_NAME:$CIRCLE_BRANCH-amd64
docker tag contentful-labs/coredns-nodecache-arm64:latest $IMAGE_NAME:$CIRCLE_BRANCH-arm64
echo "$docker_password" | docker login -u "$docker_login" --password-stdin
docker push $IMAGE_NAME:$CIRCLE_BRANCH-amd64
docker push $IMAGE_NAME:$CIRCLE_BRANCH-arm64
docker manifest create $IMAGE_NAME:$CIRCLE_BRANCH $IMAGE_NAME:$CIRCLE_BRANCH-amd64 $IMAGE_NAME:$CIRCLE_BRANCH-arm64
docker manifest annotate --arch arm64 $IMAGE_NAME:$CIRCLE_BRANCH $IMAGE_NAME:$CIRCLE_BRANCH-arm64
docker push $IMAGE_NAME:$CIRCLE_BRANCH
publish-tag:
executor: docker-publisher
Expand All @@ -52,10 +62,15 @@ jobs:
name: Load archived Docker image
command: docker load -i /tmp/workspace/image.tar
- run:
name: publish docker image with tag
name: publish docker images with tag
command: |
docker tag contentful-labs/coredns-nodecache:latest $IMAGE_NAME:$CIRCLE_TAG
docker tag contentful-labs/coredns-nodecache-amd64:latest $IMAGE_NAME:$CIRCLE_TAG-amd64
docker tag contentful-labs/coredns-nodecache-arm64:latest $IMAGE_NAME:$CIRCLE_TAG-arm64
echo "$docker_password" | docker login -u "$docker_login" --password-stdin
docker push $IMAGE_NAME:$CIRCLE_TAG-amd64
docker push $IMAGE_NAME:$CIRCLE_TAG-arm64
docker manifest create $IMAGE_NAME:$CIRCLE_TAG $IMAGE_NAME:$CIRCLE_TAG-amd64 $IMAGE_NAME:$CIRCLE_TAG-arm64
docker manifest annotate --arch arm64 $IMAGE_NAME:$CIRCLE_TAG $IMAGE_NAME:$CIRCLE_TAG-arm64
docker push $IMAGE_NAME:$CIRCLE_TAG
publish-master:
executor: docker-publisher
Expand All @@ -64,12 +79,19 @@ jobs:
at: /tmp/workspace
- run:
name: Load archived Docker image
command: docker load -i /tmp/workspace/image.tar
command: |
docker load -i /tmp/workspace/image-amd64.tar
docker load -i /tmp/workspace/image-arm64.tar
- run:
name: publish docker image with latest tag
name: publish docker images with 'latest' tag
command: |
docker tag contentful-labs/coredns-nodecache:latest $IMAGE_NAME:latest
docker tag contentful-labs/coredns-nodecache-amd64:latest $IMAGE_NAME:latest-amd64
docker tag contentful-labs/coredns-nodecache-arm64:latest $IMAGE_NAME:latest-arm64
echo "$docker_password" | docker login -u "$docker_login" --password-stdin
docker push $IMAGE_NAME:latest-amd64
docker push $IMAGE_NAME:latest-arm64
docker manifest create $IMAGE_NAME:latest $IMAGE_NAME:latest-amd64 $IMAGE_NAME:latest-arm64
docker manifest annotate --arch arm64 $IMAGE_NAME:latest $IMAGE_NAME:latest-arm64
docker push $IMAGE_NAME:latest
workflows:
version: 2
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
build:
docker build -t contentful-labs/coredns-nodecache .
docker buildx build --platform linux/amd64 -t contentful-labs/coredns-nodecache-amd64 .
docker buildx build --platform linux/arm64 -t contentful-labs/coredns-nodecache-arm64 .
docker tag contentful-labs/coredns-nodecache-amd64 contentful-labs/coredns-nodecache

run: build
docker run --cap-add=NET_ADMIN --cap-add=NET_RAW --privileged -P contentful-labs/coredns-nodecache
Expand Down