Skip to content

Commit 7c158b3

Browse files
author
bgauduch
committed
update container structure test version and improve hadolint plateform in dev script
1 parent 0404880 commit 7c158b3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dev.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ set -eo pipefail
1313
IMAGE_NAME="zenika/terraform-aws-cli"
1414
[[ -n $3 ]] && IMAGE_TAG=$3 || IMAGE_TAG="dev"
1515

16-
# Set platform for Hadolint image
17-
[[ "$(uname -m)" == "arm64" ]] && PLATFORM="linux/arm64" || PLATFORM="linux/amd64"
16+
# Set platform for Hadolint image (only linux/arm64 or linux/arm64 supported)
17+
PLATEFORM="linux/$(uname -m)"
1818

1919
# Lint Dockerfile
2020
echo "Linting Dockerfile..."
21-
docker run --rm --interactive --volume "${PWD}":/data --workdir /data --platform "${PLATFORM}" hadolint/hadolint:2.12.0-alpine /bin/hadolint --config hadolint.yaml Dockerfile
21+
docker container run --rm --interactive --volume "${PWD}":/data --workdir /data --platform "${PLATEFORM}" hadolint/hadolint:2.12.0-alpine /bin/hadolint --config hadolint.yaml Dockerfile
2222
echo "Lint Successful!"
2323

2424
# Build image
@@ -32,7 +32,7 @@ export AWS_VERSION=${AWS_VERSION} && export TF_VERSION=${TF_VERSION}
3232
envsubst '${AWS_VERSION},${TF_VERSION}' < tests/container-structure-tests.yml.template > tests/container-structure-tests.yml
3333
echo "Test config successfully generated!"
3434
echo "Executing container structure test..."
35-
docker container run --rm --interactive --volume "${PWD}"/tests/container-structure-tests.yml:/tests.yml:ro -v /var/run/docker.sock:/var/run/docker.sock:ro gcr.io/gcp-runtimes/container-structure-test:v1.10.0 test --image $IMAGE_NAME:$IMAGE_TAG --config /tests.yml
35+
docker container run --rm --interactive --volume "${PWD}"/tests/container-structure-tests.yml:/tests.yml:ro -v /var/run/docker.sock:/var/run/docker.sock:ro gcr.io/gcp-runtimes/container-structure-test:v1.14.0 test --image $IMAGE_NAME:$IMAGE_TAG --config /tests.yml
3636

3737
# cleanup
3838
unset AWS_VERSION

0 commit comments

Comments
 (0)