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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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

context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:stable
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we remove this one and only use the tag?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think keeping the stable tag is not bad. This way, if a consumer wants the latest from master, it can target latest, if he wants the latest released version can use stable, if he wants a specific tags can use it directly (e.g. v1.0.1)

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]>
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