# This Dockerfile is used to build the image available on DockerHub
FROM golang:1.17.9 as build

# Add everything
ADD . /usr/src/multus-cni

ENV GOARCH "arm"
ENV GOOS "linux"

RUN  cd /usr/src/multus-cni && \
     ./hack/build-go.sh

# build arm container
FROM arm32v7/centos:7
LABEL org.opencontainers.image.source https://github.com/k8snetworkplumbingwg/multus-cni
COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin
COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE

WORKDIR /
ADD ./images/entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh"]
