forked from corretto/corretto-8-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-image.sh
executable file
·30 lines (26 loc) · 932 Bytes
/
test-image.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
set -euo pipefail
# 1. Fetch and setup test framework.
# For more info and usage examples, see:
# https://github.com/GoogleContainerTools/container-structure-test
# only linux and osx are supported
if [[ "$OSTYPE" == "linux-gnu" ]]; then
cst_ostype="linux"
elif [[ "$OSTYPE" == "darwin"* ]]; then
cst_ostype="darwin"
else
echo "Unsupported operating system[$OSTYPE]"
exit 1
fi
mkdir -p build/tool
wget -N \
-P build/tool \
https://storage.googleapis.com/container-structure-test/latest/container-structure-test-${cst_ostype}-amd64
chmod +x build/tool/container-structure-test-${cst_ostype}-amd64
# 2. Build the docker image.
# You can set $1 to a Dockerfile to test interractively
docker build -f ${1-${DOCKER_FILE}} --tag corretto-8 .
# 3. Test using container-structure-test.
build/tool/container-structure-test-${cst_ostype}-amd64 test \
--image corretto-8 \
--config test-image.yaml