Skip to content

Commit 98ae9ef

Browse files
authored
Merge pull request docker-library#7367 from infosiftr/entrypoint
Standardize test curl image; update to buster
2 parents e2323fc + 1c8cc44 commit 98ae9ef

File tree

25 files changed

+121
-61
lines changed

25 files changed

+121
-61
lines changed

test/tests/cassandra-basics/run.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
88

99
image="$1"
1010

11-
# Use the image being tested as our client image since it should already have curl
11+
# Use the image being tested as our client image
1212
clientImage="$image"
1313

1414
# Create an instance of the container-under-test
@@ -27,7 +27,11 @@ trap "docker rm -vf $cid > /dev/null" EXIT
2727
trap "( set -x; docker logs --tail=20 $cid )" ERR
2828

2929
_status() {
30-
docker run --rm --link "$cid":cassandra "$clientImage" nodetool -h cassandra status
30+
docker run --rm \
31+
--link "$cid":cassandra \
32+
--entrypoint nodetool \
33+
"$clientImage" \
34+
-h cassandra status
3135
}
3236

3337
# Make sure our container is up
@@ -36,8 +40,9 @@ _status() {
3640
cqlsh() {
3741
docker run -i --rm \
3842
--link "$cid":cassandra \
43+
--entrypoint cqlsh \
3944
"$clientImage" \
40-
cqlsh -u cassandra -p cassandra "$@" cassandra
45+
-u cassandra -p cassandra "$@" cassandra
4146
}
4247

4348
# Make sure our container is listening

test/tests/convertigo-hello-world/run.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ set -eo pipefail
33

44
dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
55

6-
image="$1"
7-
8-
# since we have curl in the convertigo image, we'll use that
9-
clientImage="$1"
10-
116
serverImage="$1"
127

8+
# Use a client image with curl for testing
9+
clientImage='buildpack-deps:buster-curl'
10+
1311
# Create an instance of the container-under-test
1412
cid="$(docker run -d "$serverImage")"
1513
trap "docker rm -vf $cid > /dev/null" EXIT
@@ -18,7 +16,9 @@ _request() {
1816
local url="${1#/}"
1917
shift
2018

21-
docker run --rm --link "$cid":convertigo "$clientImage" \
19+
docker run --rm \
20+
--link "$cid":convertigo \
21+
"$clientImage" \
2222
curl -s "$@" "http://convertigo:28080/$url"
2323
}
2424

test/tests/elasticsearch-basics/run.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
88

99
image="$1"
1010

11-
# our image may not have "curl" (Alpine variants, for example)
12-
clientImage='buildpack-deps:stretch-curl'
11+
# Use a client image with curl for testing
12+
clientImage='buildpack-deps:buster-curl'
1313

1414
# Create an instance of the container-under-test
1515
# (explicitly setting a low memory limit since the image defaults to 2GB)
@@ -27,7 +27,8 @@ _request() {
2727
# https://github.com/docker/docker/issues/14203#issuecomment-129865960 (DOCKER_FIX)
2828
docker run --rm --link "$cid":es \
2929
-e DOCKER_FIX=' ' \
30-
"$clientImage" curl -fs -X"$method" "$@" "http://es:9200/$url"
30+
"$clientImage" \
31+
curl -fs -X"$method" "$@" "http://es:9200/$url"
3132
}
3233

3334
_trimmed() {

test/tests/ghost-basics/run.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
66
serverImage="$1"
77

88
# Use a client image with curl for testing
9-
clientImage='buildpack-deps:stretch-curl'
9+
clientImage='buildpack-deps:buster-curl'
1010

1111
# Create an instance of the container-under-test
1212
cid="$(docker run -d "$serverImage")"
@@ -19,7 +19,9 @@ _request() {
1919
local url="${1}"
2020
shift
2121

22-
docker run --rm --link "$cid":ghost "$clientImage" \
22+
docker run --rm \
23+
--link "$cid":ghost \
24+
"$clientImage" \
2325
curl -fs -X"$method" "$@" "http://ghost:2368/$url"
2426
}
2527

test/tests/haproxy-basics/run.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
88

99
image="$1"
1010

11-
clientImage='buildpack-deps:stretch-curl'
11+
clientImage='buildpack-deps:buster-curl'
1212

1313
# Create an instance of the container-under-test
1414
serverImage="$("$dir/../image-name.sh" librarytest/haproxy-basics "$image")"
@@ -35,7 +35,9 @@ _request() {
3535
false
3636
fi
3737

38-
docker run --rm --link "$cid":haproxy "$clientImage" \
38+
docker run --rm \
39+
--link "$cid":haproxy \
40+
"$clientImage" \
3941
curl -fsSL -X"$method" --connect-to '::haproxy:' "$@" "$proto://example.com/$url"
4042
}
4143

test/tests/jetty-hello-web/run.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
99
image="$1"
1010

1111
# Use a client image with curl for testing
12-
clientImage='buildpack-deps:stretch-curl'
12+
clientImage='buildpack-deps:buster-curl'
1313

1414
# Create an instance of the container-under-test
1515
serverImage="$("$dir/../image-name.sh" librarytest/jetty-hello-web "$image")"
@@ -27,7 +27,9 @@ _request() {
2727
local url="${1#/}"
2828
shift
2929

30-
docker run --rm --link "$cid":jetty "$clientImage" \
30+
docker run --rm \
31+
--link "$cid":jetty \
32+
"$clientImage" \
3133
curl -fs -X"$method" "$@" "http://jetty:8080/$url"
3234
}
3335

test/tests/logstash-basics/run.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
88

99
image="$1"
1010

11-
# our image may not have "curl" (Alpine variants, for example)
12-
clientImage='buildpack-deps:stretch-curl'
11+
# Use a client image with curl for testing
12+
clientImage='buildpack-deps:buster-curl'
1313

1414
# input via HTTP (default port 0.0.0.0:8080)
1515
# output via stdout, newline-delimited nothing-but-the-message
@@ -33,9 +33,11 @@ trap "docker rm -vf $cid > /dev/null" EXIT
3333

3434
_request() {
3535
# https://github.com/docker/docker/issues/14203#issuecomment-129865960 (DOCKER_FIX)
36-
docker run --rm --link "$cid":logstash \
36+
docker run --rm \
37+
--link "$cid":logstash \
3738
-e DOCKER_FIX=' ' \
38-
"$clientImage" curl -fs "$@" "http://logstash:8080"
39+
"$clientImage" \
40+
curl -fs "$@" "http://logstash:8080"
3941
}
4042

4143
_trimmed() {

test/tests/memcached-basics/run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ memcached-command() {
2323
} \
2424
| docker run --rm -i \
2525
--link "$cname":memcached \
26-
"$clientImage" nc memcached 11211 \
26+
"$clientImage" \
27+
nc memcached 11211 \
2728
| tr -d '\r'
2829
}
2930

test/tests/mongo-basics/run.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if docker info --format '{{ join .SecurityOptions "\n" }}' 2>/dev/null |tac|tac|
1313
# make container with jq since it is not guaranteed on the host
1414
jqImage='librarytest/mongo-basics-jq:alpine'
1515
docker build -t "$jqImage" - > /dev/null <<-'EOF'
16-
FROM alpine:3.9
16+
FROM alpine:3.11
1717
1818
RUN apk add --no-cache jq
1919
@@ -75,7 +75,7 @@ fi
7575
if [[ "$testName" == *tls* ]]; then
7676
tlsImage="$("$testDir/../image-name.sh" librarytest/mongo-tls "$image")"
7777
"$testDir/../docker-build.sh" "$testDir" "$tlsImage" <<-EOD
78-
FROM alpine:3.10 AS certs
78+
FROM alpine:3.11 AS certs
7979
RUN apk add --no-cache openssl
8080
RUN set -eux; \
8181
mkdir /certs; \
@@ -129,7 +129,11 @@ cid="$(docker_run_seccomp "${mongodRunArgs[@]}" "$image" "${mongodCmdArgs[@]}")"
129129
trap "docker rm -vf $cid > /dev/null" EXIT
130130

131131
mongo() {
132-
docker_run_seccomp --rm -i --link "$cname":mongo "$image" mongo "${mongoArgs[@]}" "$@"
132+
docker_run_seccomp --rm -i \
133+
--link "$cname":mongo \
134+
--entrypoint mongo \
135+
"$image" \
136+
"${mongoArgs[@]}" "$@"
133137
}
134138

135139
mongo_eval() {

test/tests/nextcloud-apache-run/run.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ set -eo pipefail
33

44
dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
55

6-
# since we have curl in the php image, we'll use that
7-
clientImage="$1"
86
serverImage="$1"
97

8+
# Use a client image with curl for testing
9+
clientImage='buildpack-deps:buster-curl'
10+
1011
# Create an instance of the container-under-test
1112
cid="$(docker run -d "$serverImage")"
1213
trap "docker rm -vf $cid > /dev/null" EXIT
@@ -18,7 +19,9 @@ _request() {
1819
local url="${1#/}"
1920
shift
2021

21-
docker run --rm --link "$cid":apache "$clientImage" \
22+
docker run --rm \
23+
--link "$cid":apache \
24+
"$clientImage" \
2225
curl -fsL -X"$method" "$@" "http://apache/$url"
2326
}
2427

test/tests/nextcloud-fpm-run/run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ fcgi-request() {
2929
url="${url%%\?*}"
3030
fi
3131

32-
docker run --rm -i --link "$cid":fpm \
32+
docker run --rm -i \
33+
--link "$cid":fpm \
3334
-e REQUEST_METHOD="$method" \
3435
-e SCRIPT_NAME="$url" \
3536
-e SCRIPT_FILENAME=/var/www/html/"${url#/}" \

test/tests/nuxeo-conf/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ image="$1"
66
export NUXEO_DEV_MODE='true'
77
export NUXEO_AUTOMATION_TRACE='true'
88

9+
# not using '--entrypoint nuxeoctl', since regular entrypoint does setup for nuxeoctl
910
docker run --rm -i \
1011
-e NUXEO_DEV_MODE \
1112
-e NUXEO_AUTOMATION_TRACE \

test/tests/open-liberty-hello-world/run.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
55

66
image="$1"
77

8-
# Use the alpine image since it is small and has wget in it that we can use
9-
clientImage="alpine:3.9"
8+
# Use a client image with curl for testing
9+
clientImage='buildpack-deps:buster-curl'
1010

1111
serverImage="$1"
1212

@@ -18,8 +18,10 @@ _request() {
1818
local url="${1#/}"
1919
shift
2020

21-
docker run --rm --link "$cid":open-liberty "$clientImage" \
22-
wget -q -O - "$@" "http://open-liberty:9080/$url"
21+
docker run --rm \
22+
--link "$cid":open-liberty \
23+
"$clientImage" \
24+
curl -fsSL "$@" "http://open-liberty:9080/$url"
2325
}
2426

2527
# Make sure that Open Liberty is listening

test/tests/php-apache-hello-web/run.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
55

66
image="$1"
77

8-
# since we have curl in the php image, we'll use that
9-
clientImage="$1"
8+
# Use a client image with curl for testing
9+
clientImage='buildpack-deps:buster-curl'
1010

1111
serverImage="$("$dir/../image-name.sh" librarytest/php-apache-hello-web "$image")"
1212
"$dir/../docker-build.sh" "$dir" "$serverImage" <<EOD
@@ -25,7 +25,9 @@ _request() {
2525
local url="${1#/}"
2626
shift
2727

28-
docker run --rm --link "$cid":apache "$clientImage" \
28+
docker run --rm \
29+
--link "$cid":apache \
30+
"$clientImage" \
2931
curl -fs -X"$method" "$@" "http://apache/$url"
3032
}
3133

test/tests/plone-addons/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22
set -eo pipefail
33

4+
# not using '--entrypoint', since regular entrypoint sets up config
45
docker run -i --rm \
56
-e PLONE_DEVELOP=src/eea.facetednavigation \
67
-e PLONE_ADDONS=eea.facetednavigation \

test/tests/plone-cors/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22
set -eo pipefail
33

4+
# not using '--entrypoint', since regular entrypoint sets up config
45
docker run -i --rm \
56
-e CORS_ALLOW_ORIGIN="http://example.com:4300,http://example.com:5300" \
67
-e CORS_ALLOW_METHODS="DELETE,PUT" \

test/tests/plone-versions/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22
set -eo pipefail
33

4+
# not using '--entrypoint', since regular entrypoint sets up config
45
docker run -i --rm \
56
-e PLONE_DEVELOP=src/eea.facetednavigation \
67
-e PLONE_ADDONS=eea.facetednavigation \

test/tests/rabbitmq-basics/run.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ cid="$(docker run -d --name "$cname" "$serverImage")"
1919
trap "docker rm -vf $cid > /dev/null" EXIT
2020

2121
client() {
22-
docker run -i --rm --link "$cname":rabbitmq "$clientImage" "$@"
22+
docker run -i --rm \
23+
--link "$cname":rabbitmq \
24+
"$clientImage" \
25+
"$@"
2326
}
2427

2528
. "$dir/../../retry.sh" 'client testconn.py'

test/tests/rabbitmq-tls/run.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ EOD
2727

2828
testImage="$("$dir/../image-name.sh" librarytest/rabbitmq-tls-test "$1")"
2929
"$dir/../docker-build.sh" "$dir" "$testImage" <<'EOD'
30-
FROM alpine:3.10
30+
FROM alpine:3.11
3131
RUN apk add --no-cache bash coreutils drill openssl procps
3232
# https://github.com/drwetter/testssl.sh/releases
3333
ENV TESTSSL_VERSION 2.9.5-8
@@ -46,15 +46,25 @@ cid="$(docker run -d --name "$cname" --hostname "$cname" -e RABBITMQ_ERLANG_COOK
4646
trap "docker rm -vf $cid > /dev/null" EXIT
4747

4848
testssl() {
49-
docker run -i --rm --link "$cname" "$testImage" \
49+
docker run -i --rm \
50+
--link "$cname" \
51+
"$testImage" \
5052
testssl.sh --quiet --color 0 "$@" "$cname:5671"
5153
}
5254
rabbitmqctl() {
53-
docker run -i --rm --link "$cname" -e RABBITMQ_ERLANG_COOKIE "$serverImage" \
55+
# not using '--entrypoint', since regular entrypoint does needed env setup
56+
docker run -i --rm \
57+
--link "$cname" \
58+
-e RABBITMQ_ERLANG_COOKIE \
59+
"$serverImage" \
5460
rabbitmqctl --node "rabbit@$cname" "$@"
5561
}
5662
rabbitmq-diagnostics() {
57-
docker run -i --rm --link "$cname" -e RABBITMQ_ERLANG_COOKIE "$serverImage" \
63+
# not using '--entrypoint', since regular entrypoint does needed env setup
64+
docker run -i --rm \
65+
--link "$cname" \
66+
-e RABBITMQ_ERLANG_COOKIE \
67+
"$serverImage" \
5868
rabbitmq-diagnostics --node "rabbit@$cname" "$@"
5969
}
6070

test/tests/rapidoid-hello-world/run.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
99
image="$1"
1010

1111
# Use a client image with curl for testing
12-
clientImage='buildpack-deps:stretch-curl'
12+
clientImage='buildpack-deps:buster-curl'
1313

1414
# Create an instance of the container-under-test
1515
serverImage="$("$dir/../image-name.sh" librarytest/rapidoid-hello-web "$image")"
@@ -31,7 +31,9 @@ _request() {
3131
local url="${1#/}"
3232
shift
3333

34-
docker run --rm --link "$cid":rapidoid "$clientImage" \
34+
docker run --rm \
35+
--link "$cid":rapidoid \
36+
"$clientImage" \
3537
curl -fs -X"$method" "$@" "http://rapidoid:8888/$url"
3638
}
3739

0 commit comments

Comments
 (0)