diff --git a/.travis.yml b/.travis.yml index 9af4095..65e22b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: go -sudo: false +sudo: required go: - 1.9.x env: diff --git a/Dockerfile b/Dockerfile index 07bbe20..d74cf4d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,9 @@ +# build stage +FROM golang:alpine AS build-env +ADD . /go/src/github.com/niilo/clamav-rest/ +RUN cd /go/src/github.com/niilo/clamav-rest && go build -v + +# dockerize stage FROM alpine MAINTAINER Niilo Ursin @@ -12,7 +18,7 @@ RUN sed -i 's/^#Foreground .*$/Foreground true/g' /etc/clamav/clamd.conf \ RUN freshclam --quiet COPY entrypoint.sh /usr/bin/ -COPY clamav-rest /usr/bin/ +COPY --from=build-env /go/src/github.com/niilo/clamav-rest/clamav-rest /usr/bin/ EXPOSE 9000