1
0
Fork 0
mirror of https://github.com/vbatts/imgsrv.git synced 2024-12-24 23:06:31 +00:00

small container build

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2019-03-11 15:57:01 -04:00
parent 3c732c3b43
commit 7fac419675
Signed by: vbatts
GPG key ID: 10937E57733F1362

View file

@ -1,11 +1,14 @@
FROM fedora FROM golang as build
EXPOSE 7777
ENV GOPATH /usr/local WORKDIR /go/src/github.com/vbatts/imgsrv
COPY . .
RUN go install -tags netgo github.com/vbatts/imgsrv
FROM busybox as prod
ENV MONGODB_DATABASE filesrv ENV MONGODB_DATABASE filesrv
ENV MONGODB_SERVICE_HOST 127.0.0.1 ENV MONGODB_SERVICE_HOST 127.0.0.1
ENV MONGODB_SERVICE_PORT 27017 ENV MONGODB_SERVICE_PORT 27017
RUN dnf install -y golang git bzr && \ EXPOSE 7777
go get github.com/vbatts/imgsrv && \ COPY --from=build /go/bin/imgsrv /usr/local/bin/imgsrv
rm -rf /usr/local/pkg && \ COPY --from=build /go/src/github.com/vbatts/imgsrv/run.sh /usr/local/bin/run.sh
dnf remove -y golang git bzr ENTRYPOINT ["/bin/sh", "/usr/local/bin/run.sh"]
ENTRYPOINT ["/bin/sh", "/usr/local/src/github.com/vbatts/imgsrv/run.sh"]