Browse Source

Use lighter docker images (Alpine < Debian)

content-update
Xavier Petit 4 years ago committed by xpetit
parent
commit
7a511ad233
  1. 5
      tests/go/Dockerfile
  2. 7
      tests/sh/Dockerfile
  3. 6
      tests/sh/entrypoint.sh

5
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"]

7
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"]

6
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

Loading…
Cancel
Save