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

Publish container image #122

Merged
merged 3 commits into from
Dec 2, 2024

Conversation

zeeke
Copy link
Member

@zeeke zeeke commented Nov 19, 2024

  • Build plugin image
    Add Dockerfile and related entrypoint.sh to build the binary and copy
    it to the host.

  • Build and publish images in CI
    Add GitHub configuration to publish the docker image with the plugin binary

  • Deployment file
    With this configuration, bond CNI plugin can be deployed via:

kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/bond-cni/master/manifests/bond.yml

Fixes #104

@zeeke zeeke force-pushed the us/publish-images branch 3 times, most recently from 6f7b664 to 45c830d Compare November 20, 2024 10:06
@zeeke
Copy link
Member Author

zeeke commented Nov 20, 2024

@mlguerrero12 @Eoghan1232 @SchSeba please take a look when you have time.

Copy link
Collaborator

@Eoghan1232 Eoghan1232 left a comment

Choose a reason for hiding this comment

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

lgtm!

@@ -0,0 +1,15 @@
# This Dockerfile is used to build the image available on DockerHub
FROM golang:1.23 AS build
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can you add docker.io/

COPY . .
RUN make build-bin

FROM alpine:latest
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you add docker.io/

LABEL org.opencontainers.image.source=https://github.com/k8snetworkplumbingwg/bond-cni
WORKDIR /
COPY --from=build /usr/src/bond-cni/bin .
COPY --from=build /usr/src/bond-cni/LICENSE .
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can we just copy directly and not from the other container?

WORKDIR /
COPY --from=build /usr/src/bond-cni/bin .
COPY --from=build /usr/src/bond-cni/LICENSE .
COPY --from=build /usr/src/bond-cni/images/entrypoint.sh .
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can we just copy directly and not from the other container?

volumes:
- name: cnibin
hostPath:
path: /host/opt/cni/bin/
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: please add a new line here

volumes:
- name: cnibin
hostPath:
path: /host/opt/cni/bin/
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one doesn't see right the hostPath should be opt/cni/bin and inside the container we should have /host/opt/cni/bin/ no?

Copy link
Member Author

Choose a reason for hiding this comment

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

right. Also @Eoghan1232 noticed that.
For some reason, it worked on my cluster.

Fixing

.github/workflows/image-push-release.yml Show resolved Hide resolved
Add Dockerfile and related entrypoint.sh to build the binary and copy
it to the host.

Signed-off-by: Andrea Panattoni <[email protected]>
Add GitHub configuration to publish the docker image with the plugin binary

Signed-off-by: Andrea Panattoni <[email protected]>
With this configuration, `bond` CNI plugin can be deployed via:

```
kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/bond-cni/master/manifests/bond.yml

```

Signed-off-by: Andrea Panattoni <[email protected]>
@zeeke zeeke force-pushed the us/publish-images branch from 45c830d to d79f9ea Compare November 21, 2024 09:35
@zeeke zeeke requested a review from SchSeba November 27, 2024 16:21
Copy link
Collaborator

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

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

LGTM

nice work!

@SchSeba SchSeba merged commit 343231b into k8snetworkplumbingwg:master Dec 2, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

Official container and kubernetes manifests associated with this project
3 participants