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

0 commit comments

Comments
 (0)