Browse code

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>

CrazyMax authored on 2022/11/25 18:37:05
Showing 11 changed files
1 1
deleted file mode 100644
... ...
@@ -1,84 +0,0 @@
1
-ARG GO_VERSION=1.20.4
2
-
3
-FROM golang:${GO_VERSION}-alpine AS base
4
-ENV GO111MODULE=off
5
-RUN apk --no-cache add \
6
-    bash \
7
-    build-base \
8
-    curl \
9
-    lvm2-dev \
10
-    jq
11
-
12
-RUN mkdir -p /build/
13
-RUN mkdir -p /go/src/github.com/docker/docker/
14
-WORKDIR /go/src/github.com/docker/docker/
15
-
16
-FROM base AS frozen-images
17
-# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
18
-COPY contrib/download-frozen-image-v2.sh /
19
-RUN /download-frozen-image-v2.sh /build \
20
-        busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 \
21
-        busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 \
22
-        debian:bullseye-slim@sha256:dacf278785a4daa9de07596ec739dbc07131e189942772210709c5c0777e8437 \
23
-        hello-world:latest@sha256:d58e752213a51785838f9eed2b7a498ffa1cb3aa7f946dda11af39286c3db9a9 \
24
-        arm32v7/hello-world:latest@sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1
25
-# See also frozenImages in "testutil/environment/protect.go" (which needs to be updated when adding images to this list)
26
-
27
-FROM base AS dockercli
28
-COPY hack/dockerfile/install/install.sh ./install.sh
29
-COPY hack/dockerfile/install/dockercli.installer ./
30
-RUN PREFIX=/build ./install.sh dockercli
31
-
32
-# TestDockerCLIBuildSuite dependency
33
-FROM base AS contrib
34
-COPY contrib/syscall-test           /build/syscall-test
35
-COPY contrib/httpserver/Dockerfile  /build/httpserver/Dockerfile
36
-COPY contrib/httpserver             contrib/httpserver
37
-RUN CGO_ENABLED=0 go build -buildmode=pie -o /build/httpserver/httpserver github.com/docker/docker/contrib/httpserver
38
-
39
-# Build the integration tests and copy the resulting binaries to /build/tests
40
-FROM base AS builder
41
-
42
-# Set tag and add sources
43
-COPY . .
44
-# Copy test sources tests that use assert can print errors
45
-RUN mkdir -p /build${PWD} && find integration integration-cli -name \*_test.go -exec cp --parents '{}' /build${PWD} \;
46
-# Build and install test binaries
47
-ARG DOCKER_GITCOMMIT=undefined
48
-RUN hack/make.sh build-integration-test-binary
49
-RUN mkdir -p /build/tests && find . -name test.main -exec cp --parents '{}' /build/tests \;
50
-
51
-## Generate testing image
52
-FROM alpine:3.10 as runner
53
-
54
-ENV DOCKER_REMOTE_DAEMON=1
55
-ENV DOCKER_INTEGRATION_DAEMON_DEST=/
56
-ENTRYPOINT ["/scripts/run.sh"]
57
-
58
-# Add an unprivileged user to be used for tests which need it
59
-RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash
60
-
61
-# GNU tar is used for generating the emptyfs image
62
-RUN apk --no-cache add \
63
-    bash \
64
-    ca-certificates \
65
-    g++ \
66
-    git \
67
-    inetutils-ping \
68
-    iptables \
69
-    libcap2-bin \
70
-    pigz \
71
-    tar \
72
-    xz
73
-
74
-COPY hack/test/e2e-run.sh           /scripts/run.sh
75
-COPY hack/make/.build-empty-images  /scripts/build-empty-images.sh
76
-
77
-COPY integration/testdata       /tests/integration/testdata
78
-COPY integration/build/testdata /tests/integration/build/testdata
79
-COPY integration-cli/fixtures   /tests/integration-cli/fixtures
80
-
81
-COPY --from=frozen-images /build/ /docker-frozen-images
82
-COPY --from=dockercli     /build/ /usr/bin/
83
-COPY --from=contrib       /build/ /tests/contrib/
84
-COPY --from=builder       /build/ /
... ...
@@ -7,10 +7,6 @@ BUILDX ?= $(DOCKER) buildx
7 7
 DOCKER_GRAPHDRIVER := $(if $(DOCKER_GRAPHDRIVER),$(DOCKER_GRAPHDRIVER),$(shell docker info 2>&1 | grep "Storage Driver" | sed 's/.*: //'))
8 8
 export DOCKER_GRAPHDRIVER
9 9
 
10
-# get OS/Arch of docker engine
11
-DOCKER_OSARCH := $(shell bash -c 'source hack/make/.detect-daemon-osarch && echo $${DOCKER_ENGINE_OSARCH}')
12
-DOCKERFILE := $(shell bash -c 'source hack/make/.detect-daemon-osarch && echo $${DOCKERFILE}')
13
-
14 10
 DOCKER_GITCOMMIT := $(shell git rev-parse --short HEAD || echo unsupported)
15 11
 export DOCKER_GITCOMMIT
16 12
 
... ...
@@ -140,7 +136,7 @@ ifdef DOCKER_SYSTEMD
140 140
 DOCKER_BUILD_ARGS += --build-arg=SYSTEMD=true
141 141
 endif
142 142
 
143
-BUILD_OPTS := ${BUILD_APT_MIRROR} ${DOCKER_BUILD_ARGS} ${DOCKER_BUILD_OPTS} -f "$(DOCKERFILE)"
143
+BUILD_OPTS := ${BUILD_APT_MIRROR} ${DOCKER_BUILD_ARGS} ${DOCKER_BUILD_OPTS}
144 144
 BUILD_CMD := $(BUILDX) build
145 145
 BAKE_CMD := $(BUILDX) bake
146 146
 
147 147
deleted file mode 100644
... ...
@@ -1,43 +0,0 @@
1
-#!/usr/bin/env bash
2
-set -e
3
-
4
-docker-version-osarch() {
5
-	if ! type docker &> /dev/null; then
6
-		# docker is not installed
7
-		return
8
-	fi
9
-	local target="$1" # "Client" or "Server"
10
-	local fmtStr="{{.${target}.Os}}/{{.${target}.Arch}}"
11
-	if docker version -f "$fmtStr" 2> /dev/null; then
12
-		# if "docker version -f" works, let's just use that!
13
-		return
14
-	fi
15
-	docker version | awk '
16
-		$1 ~ /^(Client|Server):$/ { section = 0 }
17
-		$1 == "'"$target"':" { section = 1; next }
18
-		section && $1 == "OS/Arch:" { print $2 }
19
-
20
-		# old versions of Docker
21
-		$1 == "OS/Arch" && $2 == "('"${target,,}"'):" { print $3 }
22
-	'
23
-}
24
-
25
-# Retrieve OS/ARCH of docker daemon, e.g. linux/amd64
26
-export DOCKER_ENGINE_OSARCH="${DOCKER_ENGINE_OSARCH:=$(docker-version-osarch 'Server')}"
27
-export DOCKER_ENGINE_GOOS="${DOCKER_ENGINE_OSARCH%/*}"
28
-export DOCKER_ENGINE_GOARCH="${DOCKER_ENGINE_OSARCH##*/}"
29
-DOCKER_ENGINE_GOARCH=${DOCKER_ENGINE_GOARCH:=amd64}
30
-
31
-# and the client, just in case
32
-export DOCKER_CLIENT_OSARCH="$(docker-version-osarch 'Client')"
33
-export DOCKER_CLIENT_GOOS="${DOCKER_CLIENT_OSARCH%/*}"
34
-export DOCKER_CLIENT_GOARCH="${DOCKER_CLIENT_OSARCH##*/}"
35
-DOCKER_CLIENT_GOARCH=${DOCKER_CLIENT_GOARCH:=amd64}
36
-
37
-DOCKERFILE='Dockerfile'
38
-
39
-if [ "${DOCKER_ENGINE_GOOS:-$DOCKER_CLIENT_GOOS}" = "windows" ]; then
40
-	DOCKERFILE='Dockerfile.windows'
41
-fi
42
-
43
-export DOCKERFILE
44 1
deleted file mode 100644
... ...
@@ -1,7 +0,0 @@
1
-#!/usr/bin/env bash
2
-set -e
3
-
4
-source "$MAKEDIR/.detect-daemon-osarch"
5
-if [ "$DOCKER_ENGINE_GOOS" != "windows" ]; then
6
-	bundle .build-empty-images
7
-fi
... ...
@@ -149,3 +149,7 @@ while ! ${TEST_CLIENT_BINARY} version &> /dev/null; do
149 149
 	sleep 2
150 150
 done
151 151
 printf "\n"
152
+
153
+if [ "$(docker version --format '{{ .Server.Os }}')" != 'windows' ]; then
154
+	bundle .build-empty-images
155
+fi
... ...
@@ -160,7 +160,6 @@ test_env() {
160 160
 			DOCKER_REMAP_ROOT="$DOCKER_REMAP_ROOT" \
161 161
 			DOCKER_REMOTE_DAEMON="$DOCKER_REMOTE_DAEMON" \
162 162
 			DOCKER_ROOTLESS="$DOCKER_ROOTLESS" \
163
-			DOCKERFILE="$DOCKERFILE" \
164 163
 			GITHUB_ACTIONS="$GITHUB_ACTIONS" \
165 164
 			GOCACHE="$GOCACHE" \
166 165
 			GOPATH="$GOPATH" \
167 166
deleted file mode 100755
... ...
@@ -1,7 +0,0 @@
1
-#!/usr/bin/env bash
2
-# required by https://github.com/AkihiroSuda/kube-moby-integration
3
-set -e
4
-
5
-source hack/make/.integration-test-helpers
6
-
7
-build_test_suite_binaries
... ...
@@ -12,7 +12,6 @@ fi
12 12
 	env
13 13
 	build_test_suite_binaries
14 14
 	bundle .integration-daemon-start
15
-	bundle .integration-daemon-setup
16 15
 
17 16
 	testexit=0
18 17
 	(repeat run_test_integration) || testexit=$?
19 18
deleted file mode 100755
... ...
@@ -1,6 +0,0 @@
1
-#!/usr/bin/env bash
2
-set -e
3
-echo "WARNING: test-integration-cli is DEPRECATED. Use test-integration." >&2
4
-
5
-# TODO: remove this and exit 1 once CI has changed to use test-integration
6
-bundle test-integration
... ...
@@ -1,7 +1,6 @@
1 1
 #!/usr/bin/env bash
2 2
 
3 3
 bundle .integration-daemon-start
4
-bundle .integration-daemon-setup
5 4
 
6 5
 export ABS_DEST
7 6
 bash +e
... ...
@@ -59,7 +59,6 @@ test_env() {
59 59
 			DOCKER_HOST="$DOCKER_HOST" \
60 60
 			DOCKER_REMAP_ROOT="$DOCKER_REMAP_ROOT" \
61 61
 			DOCKER_REMOTE_DAEMON="$DOCKER_REMOTE_DAEMON" \
62
-			DOCKERFILE="$DOCKERFILE" \
63 62
 			GOPATH="$GOPATH" \
64 63
 			GOTRACEBACK=all \
65 64
 			HOME="$ABS_DEST/fake-HOME" \