diff --git a/Dockerfile b/Dockerfile index 7ccd460cd3..6330249d55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -177,13 +177,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=bind,src=hack/dockerfile/install,target=/tmp/install \ PREFIX=/build /tmp/install/install.sh containerd -FROM dev-base AS proxy -ARG LIBNETWORK_COMMIT -RUN --mount=type=cache,target=/root/.cache/go-build \ - --mount=type=cache,target=/go/pkg/mod \ - --mount=type=bind,src=hack/dockerfile/install,target=/tmp/install \ - PREFIX=/build /tmp/install/install.sh proxy - FROM base AS golangci_lint ARG GOLANGCI_LINT_COMMIT RUN --mount=type=cache,target=/root/.cache/go-build \ @@ -318,7 +311,6 @@ COPY --from=runc /build/ /usr/local/bin/ COPY --from=containerd /build/ /usr/local/bin/ COPY --from=rootlesskit /build/ /usr/local/bin/ COPY --from=vpnkit /build/ /usr/local/bin/ -COPY --from=proxy /build/ /usr/local/bin/ ENV PATH=/usr/local/cli:$PATH ARG DOCKER_BUILDTAGS ENV DOCKER_BUILDTAGS="${DOCKER_BUILDTAGS}" @@ -364,7 +356,6 @@ COPY --from=tini /build/ /usr/local/bin/ COPY --from=runc /build/ /usr/local/bin/ COPY --from=containerd /build/ /usr/local/bin/ COPY --from=rootlesskit /build/ /usr/local/bin/ -COPY --from=proxy /build/ /usr/local/bin/ COPY --from=vpnkit /build/ /usr/local/bin/ WORKDIR /go/src/github.com/docker/docker diff --git a/Jenkinsfile b/Jenkinsfile index 8b834f561f..ca5680553b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -121,7 +121,7 @@ pipeline { -e VALIDATE_BRANCH=${CHANGE_TARGET} \ docker:${GIT_COMMIT} \ hack/make.sh \ - dynbinary-daemon \ + dynbinary \ test-docker-py ''' } @@ -160,7 +160,7 @@ pipeline { -e DOCKER_GITCOMMIT=${GIT_COMMIT} \ -e DOCKER_GRAPHDRIVER \ docker:${GIT_COMMIT} \ - hack/make.sh binary-daemon + hack/make.sh binary ''' } } @@ -319,7 +319,7 @@ pipeline { -e DOCKER_GRAPHDRIVER \ docker:${GIT_COMMIT} \ hack/make.sh \ - dynbinary-daemon + dynbinary # flaky + integration TEST_INTEGRATION_DEST=1 CONTAINER_NAME=${CONTAINER_NAME}-1 TEST_SKIP_INTEGRATION_CLI=1 run_tests test-integration-flaky & diff --git a/hack/make/.binary b/hack/make/.binary index d56e3f3126..5ea3e373f2 100644 --- a/hack/make/.binary +++ b/hack/make/.binary @@ -8,8 +8,6 @@ binary_extension() { fi } -GO_PACKAGE='github.com/docker/docker/cmd/dockerd' -BINARY_SHORT_NAME='dockerd' BINARY_NAME="$BINARY_SHORT_NAME-$VERSION" BINARY_EXTENSION="$(binary_extension)" BINARY_FULLNAME="$BINARY_NAME$BINARY_EXTENSION" diff --git a/hack/make/binary b/hack/make/binary index eab69bb065..9e24410adb 100644 --- a/hack/make/binary +++ b/hack/make/binary @@ -7,4 +7,5 @@ rm -rf "$DEST" DEST="${DEST}-daemon" ABS_DEST="${ABS_DEST}-daemon" . hack/make/binary-daemon + . hack/make/binary-proxy ) diff --git a/hack/make/binary-daemon b/hack/make/binary-daemon index fd77aabb5b..fffceabc06 100644 --- a/hack/make/binary-daemon +++ b/hack/make/binary-daemon @@ -14,7 +14,7 @@ copy_binaries() { return fi echo "Copying nested executables into $dir" - for file in containerd containerd-shim containerd-shim-runc-v2 ctr runc docker-init docker-proxy rootlesskit rootlesskit-docker-proxy dockerd-rootless.sh dockerd-rootless-setuptool.sh; do + for file in containerd containerd-shim containerd-shim-runc-v2 ctr runc docker-init rootlesskit rootlesskit-docker-proxy dockerd-rootless.sh dockerd-rootless-setuptool.sh; do cp -f "$(command -v "$file")" "$dir/" if [ "$hash" = "hash" ]; then hash_files "$dir/$file" @@ -31,5 +31,11 @@ copy_binaries() { } [ -z "$KEEPDEST" ] && rm -rf "$DEST" -source "${MAKEDIR}/.binary" -copy_binaries "$DEST" 'hash' + +( + GO_PACKAGE='github.com/docker/docker/cmd/dockerd' + BINARY_SHORT_NAME='dockerd' + + source "${MAKEDIR}/.binary" + copy_binaries "$DEST" 'hash' +) diff --git a/hack/make/binary-proxy b/hack/make/binary-proxy new file mode 100644 index 0000000000..c0270fed9e --- /dev/null +++ b/hack/make/binary-proxy @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e + +( + GO_PACKAGE='github.com/docker/docker/libnetwork/cmd/proxy' + BINARY_SHORT_NAME='docker-proxy' + + source "${MAKEDIR}/.binary" +) diff --git a/hack/make/dynbinary b/hack/make/dynbinary index 2424046e98..08ce8b5725 100644 --- a/hack/make/dynbinary +++ b/hack/make/dynbinary @@ -1,9 +1,11 @@ #!/usr/bin/env bash set -e +rm -rf "$DEST" # This script exists as backwards compatibility for CI ( DEST="${DEST}-daemon" ABS_DEST="${ABS_DEST}-daemon" . hack/make/dynbinary-daemon + . hack/make/dynbinary-proxy ) diff --git a/hack/make/dynbinary-daemon b/hack/make/dynbinary-daemon index 67622338c9..fe2413d734 100644 --- a/hack/make/dynbinary-daemon +++ b/hack/make/dynbinary-daemon @@ -1,11 +1,16 @@ #!/usr/bin/env bash set -e +[ -z "$KEEPDEST" ] && rm -rf "$DEST" + ( export IAMSTATIC='false' export LDFLAGS_STATIC_DOCKER='' export BUILDFLAGS=("${BUILDFLAGS[@]/netgo /}") # disable netgo, since we don't need it for a dynamic binary export BUILDFLAGS=("${BUILDFLAGS[@]/osusergo /}") # ditto for osusergo export BUILDFLAGS=("${BUILDFLAGS[@]/static_build /}") # we're not building a "static" binary here + + GO_PACKAGE='github.com/docker/docker/cmd/dockerd' + BINARY_SHORT_NAME='dockerd' source "${MAKEDIR}/.binary" ) diff --git a/hack/make/dynbinary-proxy b/hack/make/dynbinary-proxy new file mode 100644 index 0000000000..e97a15b311 --- /dev/null +++ b/hack/make/dynbinary-proxy @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -e + +( + export IAMSTATIC='false' + export LDFLAGS_STATIC_DOCKER='' + export BUILDFLAGS=("${BUILDFLAGS[@]/netgo /}") # disable netgo, since we don't need it for a dynamic binary + export BUILDFLAGS=("${BUILDFLAGS[@]/osusergo /}") # ditto for osusergo + export BUILDFLAGS=("${BUILDFLAGS[@]/static_build /}") # we're not building a "static" binary here + + GO_PACKAGE='github.com/docker/docker/libnetwork/cmd/proxy' + BINARY_SHORT_NAME='docker-proxy' + source "${MAKEDIR}/.binary" +)