Browse Source

remove Dockerfile.e2e

Dockerfile.e2e is not used anymore. Integration tests run
through the main Dockerfile.

Also removes the daemon OS/Arch detection script that is not
necessary anymore. It was used to select the Dockerfile based
on the arch like Dockerfile.arm64 but we don't have those
anymore. Was also used to check referenced frozen images
in the Dockerfile.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 5efe72415d975ec0d4e097cfc235bd6c6c62418b)
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
CrazyMax 2 years ago
parent
commit
aaf84dd4cf

+ 0 - 84
Dockerfile.e2e

@@ -1,84 +0,0 @@
-ARG GO_VERSION=1.20.4
-
-FROM golang:${GO_VERSION}-alpine AS base
-ENV GO111MODULE=off
-RUN apk --no-cache add \
-    bash \
-    build-base \
-    curl \
-    lvm2-dev \
-    jq
-
-RUN mkdir -p /build/
-RUN mkdir -p /go/src/github.com/docker/docker/
-WORKDIR /go/src/github.com/docker/docker/
-
-FROM base AS frozen-images
-# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
-COPY contrib/download-frozen-image-v2.sh /
-RUN /download-frozen-image-v2.sh /build \
-        busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 \
-        busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 \
-        debian:bullseye-slim@sha256:dacf278785a4daa9de07596ec739dbc07131e189942772210709c5c0777e8437 \
-        hello-world:latest@sha256:d58e752213a51785838f9eed2b7a498ffa1cb3aa7f946dda11af39286c3db9a9 \
-        arm32v7/hello-world:latest@sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1
-# See also frozenImages in "testutil/environment/protect.go" (which needs to be updated when adding images to this list)
-
-FROM base AS dockercli
-COPY hack/dockerfile/install/install.sh ./install.sh
-COPY hack/dockerfile/install/dockercli.installer ./
-RUN PREFIX=/build ./install.sh dockercli
-
-# TestDockerCLIBuildSuite dependency
-FROM base AS contrib
-COPY contrib/syscall-test           /build/syscall-test
-COPY contrib/httpserver/Dockerfile  /build/httpserver/Dockerfile
-COPY contrib/httpserver             contrib/httpserver
-RUN CGO_ENABLED=0 go build -buildmode=pie -o /build/httpserver/httpserver github.com/docker/docker/contrib/httpserver
-
-# Build the integration tests and copy the resulting binaries to /build/tests
-FROM base AS builder
-
-# Set tag and add sources
-COPY . .
-# Copy test sources tests that use assert can print errors
-RUN mkdir -p /build${PWD} && find integration integration-cli -name \*_test.go -exec cp --parents '{}' /build${PWD} \;
-# Build and install test binaries
-ARG DOCKER_GITCOMMIT=undefined
-RUN hack/make.sh build-integration-test-binary
-RUN mkdir -p /build/tests && find . -name test.main -exec cp --parents '{}' /build/tests \;
-
-## Generate testing image
-FROM alpine:3.10 as runner
-
-ENV DOCKER_REMOTE_DAEMON=1
-ENV DOCKER_INTEGRATION_DAEMON_DEST=/
-ENTRYPOINT ["/scripts/run.sh"]
-
-# Add an unprivileged user to be used for tests which need it
-RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash
-
-# GNU tar is used for generating the emptyfs image
-RUN apk --no-cache add \
-    bash \
-    ca-certificates \
-    g++ \
-    git \
-    inetutils-ping \
-    iptables \
-    libcap2-bin \
-    pigz \
-    tar \
-    xz
-
-COPY hack/test/e2e-run.sh           /scripts/run.sh
-COPY hack/make/.build-empty-images  /scripts/build-empty-images.sh
-
-COPY integration/testdata       /tests/integration/testdata
-COPY integration/build/testdata /tests/integration/build/testdata
-COPY integration-cli/fixtures   /tests/integration-cli/fixtures
-
-COPY --from=frozen-images /build/ /docker-frozen-images
-COPY --from=dockercli     /build/ /usr/bin/
-COPY --from=contrib       /build/ /tests/contrib/
-COPY --from=builder       /build/ /

+ 1 - 5
Makefile

@@ -7,10 +7,6 @@ BUILDX ?= $(DOCKER) buildx
 DOCKER_GRAPHDRIVER := $(if $(DOCKER_GRAPHDRIVER),$(DOCKER_GRAPHDRIVER),$(shell docker info 2>&1 | grep "Storage Driver" | sed 's/.*: //'))
 DOCKER_GRAPHDRIVER := $(if $(DOCKER_GRAPHDRIVER),$(DOCKER_GRAPHDRIVER),$(shell docker info 2>&1 | grep "Storage Driver" | sed 's/.*: //'))
 export DOCKER_GRAPHDRIVER
 export DOCKER_GRAPHDRIVER
 
 
-# get OS/Arch of docker engine
-DOCKER_OSARCH := $(shell bash -c 'source hack/make/.detect-daemon-osarch && echo $${DOCKER_ENGINE_OSARCH}')
-DOCKERFILE := $(shell bash -c 'source hack/make/.detect-daemon-osarch && echo $${DOCKERFILE}')
-
 DOCKER_GITCOMMIT := $(shell git rev-parse --short HEAD || echo unsupported)
 DOCKER_GITCOMMIT := $(shell git rev-parse --short HEAD || echo unsupported)
 export DOCKER_GITCOMMIT
 export DOCKER_GITCOMMIT
 
 
@@ -150,7 +146,7 @@ ifdef DOCKER_SYSTEMD
 DOCKER_BUILD_ARGS += --build-arg=SYSTEMD=true
 DOCKER_BUILD_ARGS += --build-arg=SYSTEMD=true
 endif
 endif
 
 
-BUILD_OPTS := ${BUILD_APT_MIRROR} ${DOCKER_BUILD_ARGS} ${DOCKER_BUILD_OPTS} -f "$(DOCKERFILE)"
+BUILD_OPTS := ${BUILD_APT_MIRROR} ${DOCKER_BUILD_ARGS} ${DOCKER_BUILD_OPTS}
 BUILD_CMD := $(BUILDX) build
 BUILD_CMD := $(BUILDX) build
 BAKE_CMD := $(BUILDX) bake
 BAKE_CMD := $(BUILDX) bake
 
 

+ 0 - 43
hack/make/.detect-daemon-osarch

@@ -1,43 +0,0 @@
-#!/usr/bin/env bash
-set -e
-
-docker-version-osarch() {
-	if ! type docker &> /dev/null; then
-		# docker is not installed
-		return
-	fi
-	local target="$1" # "Client" or "Server"
-	local fmtStr="{{.${target}.Os}}/{{.${target}.Arch}}"
-	if docker version -f "$fmtStr" 2> /dev/null; then
-		# if "docker version -f" works, let's just use that!
-		return
-	fi
-	docker version | awk '
-		$1 ~ /^(Client|Server):$/ { section = 0 }
-		$1 == "'"$target"':" { section = 1; next }
-		section && $1 == "OS/Arch:" { print $2 }
-
-		# old versions of Docker
-		$1 == "OS/Arch" && $2 == "('"${target,,}"'):" { print $3 }
-	'
-}
-
-# Retrieve OS/ARCH of docker daemon, e.g. linux/amd64
-export DOCKER_ENGINE_OSARCH="${DOCKER_ENGINE_OSARCH:=$(docker-version-osarch 'Server')}"
-export DOCKER_ENGINE_GOOS="${DOCKER_ENGINE_OSARCH%/*}"
-export DOCKER_ENGINE_GOARCH="${DOCKER_ENGINE_OSARCH##*/}"
-DOCKER_ENGINE_GOARCH=${DOCKER_ENGINE_GOARCH:=amd64}
-
-# and the client, just in case
-export DOCKER_CLIENT_OSARCH="$(docker-version-osarch 'Client')"
-export DOCKER_CLIENT_GOOS="${DOCKER_CLIENT_OSARCH%/*}"
-export DOCKER_CLIENT_GOARCH="${DOCKER_CLIENT_OSARCH##*/}"
-DOCKER_CLIENT_GOARCH=${DOCKER_CLIENT_GOARCH:=amd64}
-
-DOCKERFILE='Dockerfile'
-
-if [ "${DOCKER_ENGINE_GOOS:-$DOCKER_CLIENT_GOOS}" = "windows" ]; then
-	DOCKERFILE='Dockerfile.windows'
-fi
-
-export DOCKERFILE

+ 0 - 7
hack/make/.integration-daemon-setup

@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-set -e
-
-source "$MAKEDIR/.detect-daemon-osarch"
-if [ "$DOCKER_ENGINE_GOOS" != "windows" ]; then
-	bundle .build-empty-images
-fi

+ 4 - 0
hack/make/.integration-daemon-start

@@ -151,3 +151,7 @@ while ! ${TEST_CLIENT_BINARY} version &> /dev/null; do
 	sleep 2
 	sleep 2
 done
 done
 printf "\n"
 printf "\n"
+
+if [ "$(docker version --format '{{ .Server.Os }}')" != 'windows' ]; then
+	bundle .build-empty-images
+fi

+ 0 - 1
hack/make/.integration-test-helpers

@@ -181,7 +181,6 @@ test_env() {
 			DOCKER_REMAP_ROOT="$DOCKER_REMAP_ROOT" \
 			DOCKER_REMAP_ROOT="$DOCKER_REMAP_ROOT" \
 			DOCKER_REMOTE_DAEMON="$DOCKER_REMOTE_DAEMON" \
 			DOCKER_REMOTE_DAEMON="$DOCKER_REMOTE_DAEMON" \
 			DOCKER_ROOTLESS="$DOCKER_ROOTLESS" \
 			DOCKER_ROOTLESS="$DOCKER_ROOTLESS" \
-			DOCKERFILE="$DOCKERFILE" \
 			GITHUB_ACTIONS="$GITHUB_ACTIONS" \
 			GITHUB_ACTIONS="$GITHUB_ACTIONS" \
 			GOCACHE="$GOCACHE" \
 			GOCACHE="$GOCACHE" \
 			GOPATH="$GOPATH" \
 			GOPATH="$GOPATH" \

+ 0 - 7
hack/make/build-integration-test-binary

@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-# required by https://github.com/AkihiroSuda/kube-moby-integration
-set -e
-
-source hack/make/.integration-test-helpers
-
-build_test_suite_binaries

+ 0 - 1
hack/make/test-integration

@@ -12,7 +12,6 @@ fi
 	env
 	env
 	build_test_suite_binaries
 	build_test_suite_binaries
 	bundle .integration-daemon-start
 	bundle .integration-daemon-start
-	bundle .integration-daemon-setup
 
 
 	testexit=0
 	testexit=0
 	(repeat run_test_integration) || testexit=$?
 	(repeat run_test_integration) || testexit=$?

+ 0 - 6
hack/make/test-integration-cli

@@ -1,6 +0,0 @@
-#!/usr/bin/env bash
-set -e
-echo "WARNING: test-integration-cli is DEPRECATED. Use test-integration." >&2
-
-# TODO: remove this and exit 1 once CI has changed to use test-integration
-bundle test-integration

+ 0 - 1
hack/make/test-integration-shell

@@ -1,7 +1,6 @@
 #!/usr/bin/env bash
 #!/usr/bin/env bash
 
 
 bundle .integration-daemon-start
 bundle .integration-daemon-start
-bundle .integration-daemon-setup
 
 
 export ABS_DEST
 export ABS_DEST
 bash +e
 bash +e

+ 0 - 1
hack/test/e2e-run.sh

@@ -59,7 +59,6 @@ test_env() {
 			DOCKER_HOST="$DOCKER_HOST" \
 			DOCKER_HOST="$DOCKER_HOST" \
 			DOCKER_REMAP_ROOT="$DOCKER_REMAP_ROOT" \
 			DOCKER_REMAP_ROOT="$DOCKER_REMAP_ROOT" \
 			DOCKER_REMOTE_DAEMON="$DOCKER_REMOTE_DAEMON" \
 			DOCKER_REMOTE_DAEMON="$DOCKER_REMOTE_DAEMON" \
-			DOCKERFILE="$DOCKERFILE" \
 			GOPATH="$GOPATH" \
 			GOPATH="$GOPATH" \
 			GOTRACEBACK=all \
 			GOTRACEBACK=all \
 			HOME="$ABS_DEST/fake-HOME" \
 			HOME="$ABS_DEST/fake-HOME" \