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 multiarch #5

Merged
merged 4 commits into from
Jan 26, 2024
Merged
Changes from 3 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
7 changes: 5 additions & 2 deletions .github/workflows/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.21"," 1.21.5","1.20",""1.20".4","1.20.5"]
go-version: ["1.21","1.21.5","1.20","1.20.4","1.20.5"]
steps:
- uses: actions/checkout@v4
- name: Calculate build vars
Expand All @@ -49,6 +49,8 @@ jobs:
else
echo "PUSH_ON_BUILD=true" >> $GITHUB_ENV
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
Expand All @@ -65,7 +67,8 @@ jobs:
CONTROLLER_GEN_VERSION: "v0.9.2"
CLIENT_GEN_VERSION: "v0.26.1"
run: |
docker build --build-arg GOLANG_VERSION=${GOLANG_VERSION} \
docker build --platform=linux/amd64,linux/arm64 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe that this will push the multi-arch image.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I am looking how to

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that for multi-arch images we use docker buildx and add the:

--output=type=image,push=$(PUSH_ON_BUILD)

flags to ensure that the multiarch image is pushed to the repo.

Copy link
Member

@elezar elezar Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, for the device plugin (note that the command below has push=false specified)

DOCKER_BUILDKIT=1 \
        docker buildx build --pull \
        --output=type=image,push=false \
        --platform=linux/amd64,linux/arm64 \
        --tag nvcr.io/nvidia/k8s-device-plugin:v0.14.3-ubuntu20.04 \
        --build-arg BASE_DIST="ubuntu20.04" \
        --build-arg CUDA_VERSION="12.3.0" \
        --build-arg GOLANG_VERSION="1.20.5" \
        --build-arg VERSION="v0.14.3" \
        --build-arg GIT_COMMIT="2bef25804caf5924f35a164158f097f954fe4c74-dirty" \
         \
        -f /Users/elezar/src/device-plugin/deployments/container/Dockerfile.ubuntu \
        /Users/elezar/src/device-plugin

--build-arg GOLANG_VERSION=${GOLANG_VERSION} \
--build-arg GOLANGCI_LINT_VERSION=${GOLANGCI_LINT_VERSION} \
--build-arg MOQ_VERSION=${MOQ_VERSION} \
--build-arg CONTROLLER_GEN_VERSION=${CONTROLLER_GEN_VERSION} \
Expand Down
Loading