From 7a511ad233bb50ad7a1a4820c3a6e63ffb8a653c Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Tue, 7 Apr 2020 20:14:15 +0200 Subject: [PATCH] Use lighter docker images (Alpine < Debian) --- tests/go/Dockerfile | 5 +++-- tests/sh/Dockerfile | 7 +++---- tests/sh/entrypoint.sh | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/go/Dockerfile b/tests/go/Dockerfile index 4bed8627..fbf09685 100644 --- a/tests/go/Dockerfile +++ b/tests/go/Dockerfile @@ -1,7 +1,8 @@ -FROM golang:1 +FROM golang:1-alpine +RUN apk add git RUN go get golang.org/x/tools/cmd/goimports RUN go get github.com/01-edu/z01 RUN go get github.com/01-edu/public/rc COPY . /app -ENTRYPOINT ["/bin/bash", "/app/entrypoint.sh"] +ENTRYPOINT ["/bin/sh", "/app/entrypoint.sh"] diff --git a/tests/sh/Dockerfile b/tests/sh/Dockerfile index ff967378..eec532b4 100644 --- a/tests/sh/Dockerfile +++ b/tests/sh/Dockerfile @@ -1,6 +1,5 @@ -FROM debian +FROM alpine -RUN apt-get update -RUN apt-get install -y jq curl git +RUN apk add jq curl git COPY . /app -ENTRYPOINT ["/bin/bash", "/app/entrypoint.sh"] +ENTRYPOINT ["/bin/sh", "/app/entrypoint.sh"] diff --git a/tests/sh/entrypoint.sh b/tests/sh/entrypoint.sh index fa090c35..1668bdfd 100755 --- a/tests/sh/entrypoint.sh +++ b/tests/sh/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/sh -# Unofficial Bash Strict Mode -set -euo pipefail +set -o errexit +set -o pipefail IFS=' ' @@ -11,5 +11,5 @@ if ! test -f ${EXERCISE}_test.sh; then echo No test file found for the exercise : "$EXERCISE" exit 1 fi -bash ${EXERCISE}_test.sh +sh ${EXERCISE}_test.sh echo PASS