-
Notifications
You must be signed in to change notification settings - Fork 27
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
base: master
Are you sure you want to change the base?
Conversation
6f7b664
to
45c830d
Compare
@mlguerrero12 @Eoghan1232 @SchSeba please take a look when you have time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
images/Dockerfile
Outdated
@@ -0,0 +1,15 @@ | |||
# This Dockerfile is used to build the image available on DockerHub | |||
FROM golang:1.23 AS build |
There was a problem hiding this comment.
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/
images/Dockerfile
Outdated
COPY . . | ||
RUN make build-bin | ||
|
||
FROM alpine:latest |
There was a problem hiding this comment.
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/
images/Dockerfile
Outdated
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 . |
There was a problem hiding this comment.
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?
images/Dockerfile
Outdated
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 . |
There was a problem hiding this comment.
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?
manifests/bond-cni.yaml
Outdated
volumes: | ||
- name: cnibin | ||
hostPath: | ||
path: /host/opt/cni/bin/ |
There was a problem hiding this comment.
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
manifests/bond-cni.yaml
Outdated
volumes: | ||
- name: cnibin | ||
hostPath: | ||
path: /host/opt/cni/bin/ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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]>
45c830d
to
d79f9ea
Compare
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:Fixes #104