diff --git a/build/Dockerfile b/build/Dockerfile index affef86244..ce0d1fc82f 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -496,7 +496,11 @@ LABEL org.nginx.kic.image.build.version="local" COPY --link --chown=101:0 nginx-ingress / # root is required for `setcap` invocation USER 0 -RUN setcap 'cap_net_bind_service=+ep' /nginx-ingress && setcap -v 'cap_net_bind_service=+ep' /nginx-ingress +RUN --mount=type=bind,target=/tmp [ -z "${BUILD_OS##*plus*}" ] && PLUS=-plus; cp -a /tmp/internal/configs/version1/nginx$PLUS.ingress.tmpl /tmp/internal/configs/version1/nginx$PLUS.tmpl \ + /tmp/internal/configs/version2/nginx$PLUS.virtualserver.tmpl /tmp/internal/configs/version2/nginx$PLUS.transportserver.tmpl / \ + && chown -R 101:0 /*.tmpl \ + && chmod -R g=u /*.tmpl \ + && setcap 'cap_net_bind_service=+ep' /nginx-ingress && setcap -v 'cap_net_bind_service=+ep' /nginx-ingress # 101 is nginx, defined above USER 101 @@ -524,7 +528,11 @@ LABEL org.nginx.kic.image.build.version="goreleaser" COPY --link --chown=101:0 dist/kubernetes-ingress_linux_${TARGETARCH}*/nginx-ingress / # root is required for `setcap` invocation USER 0 -RUN setcap 'cap_net_bind_service=+ep' /nginx-ingress && setcap -v 'cap_net_bind_service=+ep' /nginx-ingress +RUN --mount=type=bind,target=/tmp [ -z "${BUILD_OS##*plus*}" ] && PLUS=-plus; cp -a /tmp/internal/configs/version1/nginx$PLUS.ingress.tmpl /tmp/internal/configs/version1/nginx$PLUS.tmpl \ + /tmp/internal/configs/version2/nginx$PLUS.virtualserver.tmpl /tmp/internal/configs/version2/nginx$PLUS.transportserver.tmpl / \ + && chown -R 101:0 /*.tmpl \ + && chmod -R g=u /*.tmpl \ + && setcap 'cap_net_bind_service=+ep' /nginx-ingress && setcap -v 'cap_net_bind_service=+ep' /nginx-ingress # 101 is nginx, defined above USER 101 @@ -554,7 +562,11 @@ LABEL org.nginx.kic.image.build.version="aws" COPY --link --chown=101:0 dist/aws*${NAP_MODULES_AWS}_linux_${TARGETARCH}*/nginx-ingress / # root is required for `setcap` invocation USER 0 -RUN setcap 'cap_net_bind_service=+ep' /nginx-ingress && setcap -v 'cap_net_bind_service=+ep' /nginx-ingress +RUN --mount=type=bind,target=/tmp [ -z "${BUILD_OS##*plus*}" ] && PLUS=-plus; cp -a /tmp/internal/configs/version1/nginx$PLUS.ingress.tmpl /tmp/internal/configs/version1/nginx$PLUS.tmpl \ + /tmp/internal/configs/version2/nginx$PLUS.virtualserver.tmpl /tmp/internal/configs/version2/nginx$PLUS.transportserver.tmpl / \ + && chown -R 101:0 /*.tmpl \ + && chmod -R g=u /*.tmpl \ + && setcap 'cap_net_bind_service=+ep' /nginx-ingress && setcap -v 'cap_net_bind_service=+ep' /nginx-ingress # 101 is nginx, defined above USER 101