Browse Source

Use lighter docker images (Alpine < Debian)

pull/533/head
Xavier Petit 5 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 golang.org/x/tools/cmd/goimports
RUN go get github.com/01-edu/z01 RUN go get github.com/01-edu/z01
RUN go get github.com/01-edu/public/rc RUN go get github.com/01-edu/public/rc
COPY . /app 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 apk add jq curl git
RUN apt-get install -y jq curl git
COPY . /app 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 #!/bin/sh
# Unofficial Bash Strict Mode set -o errexit
set -euo pipefail set -o pipefail
IFS=' IFS='
' '
@ -11,5 +11,5 @@ if ! test -f ${EXERCISE}_test.sh; then
echo No test file found for the exercise : "$EXERCISE" echo No test file found for the exercise : "$EXERCISE"
exit 1 exit 1
fi fi
bash ${EXERCISE}_test.sh sh ${EXERCISE}_test.sh
echo PASS echo PASS

Loading…
Cancel
Save