diff --git a/Dockerfile b/Dockerfile index 98980cb8..362e7a92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM busybox:glibc +FROM busybox MAINTAINER "André Stein " diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 00000000..7117c767 --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,10 @@ +FROM alpine:3.12 + +RUN apk add --no-cache g++ clang \ + zlib-dev zlib-static curl-dev curl-static openssl openssl-dev openssl-libs-static \ + ldc dub dtools-rdmd + +COPY docker.build.sh /docker.build.sh +RUN chmod +x /docker.build.sh + +ENTRYPOINT [ "/docker.build.sh" ] diff --git a/ci/docker.build.sh b/ci/docker.build.sh new file mode 100644 index 00000000..1821dd4b --- /dev/null +++ b/ci/docker.build.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e -u + +cd /core/ +dub build -c static --compiler=ldc2 + +# remove dub folder generated with build +# as it has root permissions from docker in the build folder +rm -rf ./.dub/ diff --git a/ci/travis.sh b/ci/travis.sh index 0de864ce..c6998861 100755 --- a/ci/travis.sh +++ b/ci/travis.sh @@ -19,7 +19,9 @@ dub --compiler=${DC} -- --sanitycheck # Compile to static binary with ldc if [[ "${DC}" == "ldc2" ]]; then - dub build -c static --compiler=${DC} + docker build -t dlangtour_build ./ci/ + docker run --rm -v `pwd`:/core/ -ti dlangtour_build + docker build -t dlangtour_test_image ./ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -ti dlangtour_test_image --wait-until-pulled --sanitycheck fi