From 478cee9e4727a27c39f5bd51617de3a1efd532f4 Mon Sep 17 00:00:00 2001 From: Leopere Date: Mon, 15 Oct 2018 02:59:17 -0400 Subject: [PATCH] Starting in on some multistage --- reflector.go/Dockerfile | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/reflector.go/Dockerfile b/reflector.go/Dockerfile index 977507b..3e04002 100644 --- a/reflector.go/Dockerfile +++ b/reflector.go/Dockerfile @@ -1,10 +1,28 @@ ## base image for github.com/lbryio/reflector.go release binaries -FROM ubuntu:18:04 +FROM golang:1.11.1 as builder MAINTAINER chamunks [at] gmail [dot] com +RUN export GOROOT=$GOPATH/bin && \ + go get -v -u github.com/lbryio/reflector.go && \ + cd "/go/src/github.com/lbryio/reflector.go" && \ + make && \ + mv ./bin/prism-bin /usr/bin/prism-bin && \ + chmod +x /usr/bin/prism-bin + +## base image for github.com/lbryio/reflector.go release binaries +FROM ubuntu:18:04 as app +MAINTAINER chamunks [at] gmail [dot] com + +COPY /go/src/github.com/lbryio/reflector.go/bin/prism-bin /usr/bin/prism-bin ADD start.sh /usr/local/bin/start ADD docker-entrypoint.sh /usr/local/bin/docker-entrypoint RUN adduser reflector --gecos GECOS --shell /bin/bash --disabled-password --home /data/ && \ apt-get update && \ - apt-get -y install + apt-get -y install && \ + wget -O /data/config.tmpl https://raw.githubusercontent.com/lbryio/reflector.go/master/config.tmpl && \ + chown -R 1000:1000 /data/config.tmpl + +USER reflector + +CMD ["start"]