diff --git a/images/Dockerfile b/images/Dockerfile index 20f7a0cf1..fcaf69836 100644 --- a/images/Dockerfile +++ b/images/Dockerfile @@ -7,7 +7,7 @@ ADD . /usr/src/multus-cni RUN cd /usr/src/multus-cni && \ ./hack/build-go.sh -FROM centos:centos7 +FROM python:slim 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 diff --git a/images/Dockerfile.arm32 b/images/Dockerfile.arm32 index 1a865639a..2f6303201 100644 --- a/images/Dockerfile.arm32 +++ b/images/Dockerfile.arm32 @@ -11,7 +11,7 @@ RUN cd /usr/src/multus-cni && \ ./hack/build-go.sh # build arm container -FROM arm32v7/centos:7 +FROM arm32v7/python:slim 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 diff --git a/images/Dockerfile.arm64 b/images/Dockerfile.arm64 index 7235be7b3..0e38ee478 100644 --- a/images/Dockerfile.arm64 +++ b/images/Dockerfile.arm64 @@ -11,7 +11,7 @@ RUN cd /usr/src/multus-cni && \ ./hack/build-go.sh # build arm64 container -FROM arm64v8/centos:7 +FROM arm64v8/python:slim 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 diff --git a/images/Dockerfile.ppc64le b/images/Dockerfile.ppc64le index d91a2b05c..8d9c4f3f2 100644 --- a/images/Dockerfile.ppc64le +++ b/images/Dockerfile.ppc64le @@ -11,7 +11,7 @@ RUN cd /usr/src/multus-cni && \ ./hack/build-go.sh # build ppc container -FROM ppc64le/centos:latest +FROM ppc64le/python:slim 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 diff --git a/images/Dockerfile.s390x b/images/Dockerfile.s390x index f67b1b30c..dd3268b5b 100644 --- a/images/Dockerfile.s390x +++ b/images/Dockerfile.s390x @@ -11,7 +11,7 @@ RUN cd /usr/src/multus-cni && \ ./hack/build-go.sh # build s390x container -FROM s390x/python:3-slim +FROM s390x/python:slim 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 diff --git a/images/Dockerfile.thick b/images/Dockerfile.thick index 8c07c3518..3bedc9072 100644 --- a/images/Dockerfile.thick +++ b/images/Dockerfile.thick @@ -7,7 +7,7 @@ ADD . /usr/src/multus-cni RUN cd /usr/src/multus-cni && \ ./hack/build-go.sh -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM debian:stable-slim 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 diff --git a/images/entrypoint.sh b/images/entrypoint.sh index 0c12d899c..f566d68de 100755 --- a/images/entrypoint.sh +++ b/images/entrypoint.sh @@ -89,10 +89,6 @@ function warn() log "WARN: {$1}" } -if type python3 &> /dev/null; then - alias python=python3 -fi - function checkCniVersion { cniversion_python_tmpfile=$(mktemp) cat << EOF > $cniversion_python_tmpfile @@ -109,7 +105,7 @@ if version(v_top_level) >= v_040 and version(v_nested) < v_040: msg = "Multus cni version is %s while master plugin cni version is %s" print(msg % (v_top_level, v_nested)) EOF - python $cniversion_python_tmpfile $1 $2 + python3 $cniversion_python_tmpfile $1 $2 } # Parse parameters given as arguments to this script. @@ -378,7 +374,7 @@ if [ "$MULTUS_CONF_FILE" == "auto" ]; then if [ "$OVERRIDE_NETWORK_NAME" == "true" ]; then MASTER_PLUGIN_NET_NAME="$(cat $MULTUS_AUTOCONF_DIR/$MASTER_PLUGIN | \ - python -c 'import json,sys;print(json.load(sys.stdin)["name"])')" + python3 -c 'import json,sys;print(json.load(sys.stdin)["name"])')" else MASTER_PLUGIN_NET_NAME="multus-cni-network" fi @@ -400,7 +396,7 @@ else: EOF NESTED_CAPABILITIES_STRING="$(cat $MULTUS_AUTOCONF_DIR/$MASTER_PLUGIN | \ - python $capabilities_python_filter_tmpfile)" + python3 $capabilities_python_filter_tmpfile)" rm $capabilities_python_filter_tmpfile log "Nested capabilities string: $NESTED_CAPABILITIES_STRING"