Update Dockerfile, remove multibuild as OpenShift build does not support
This commit is contained in:
parent
0daa2ff74a
commit
d8cc0c8477
1 changed files with 17 additions and 8 deletions
25
Dockerfile
25
Dockerfile
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue