Update Dockerfile, remove multibuild as OpenShift build does not support

This commit is contained in:
Yi Sheng Yap 2019-02-13 11:20:27 +08:00
parent 0daa2ff74a
commit d8cc0c8477
No known key found for this signature in database
GPG key ID: AB94B71808869CF3

View file

@ -1,12 +1,15 @@
# build stage FROM golang:alpine
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 # Update
FROM alpine RUN apk update upgrade;
MAINTAINER Niilo Ursin <niilo.ursin+nospam_github@gmail.com>
# Set timezone to Singapore
RUN apk add tzdata
RUN mv /etc/localtime /etc/localtime.utc && \
ln -s /usr/share/zoneinfo/Asia/Singapore /etc/localtime
# Install ClamAV
RUN apk --no-cache add clamav clamav-libunrar \ RUN apk --no-cache add clamav clamav-libunrar \
&& mkdir /run/clamav \ && mkdir /run/clamav \
&& chown clamav:clamav /run/clamav && chown clamav:clamav /run/clamav
@ -17,8 +20,14 @@ RUN sed -i 's/^#Foreground .*$/Foreground true/g' /etc/clamav/clamd.conf \
RUN freshclam --quiet RUN freshclam --quiet
# Build go package
ADD . /go/src/clamav-rest/
RUN cd /go/src/clamav-rest && go build -v
COPY entrypoint.sh /usr/bin/ COPY entrypoint.sh /usr/bin/
COPY --from=build-env /go/src/github.com/niilo/clamav-rest/clamav-rest /usr/bin/ RUN mv /go/src/clamav-rest/clamav-rest /usr/bin/ && rm -Rf /go/src/clamav-rest
EXPOSE 9000 EXPOSE 9000