make docker: build a docker image for redoctober (#159)

* make docker: build a docker image for redoctober

* add a convenient entrypoint to generate certificates out of the box

* add detection based on RO_CERTS and RO_KEYS

instead of detection based on the presence of RO_DATA, add RO_CERTS and RO_KEYS
which are paths to the ceritificates and keys so we can generate them more
effectively.

Signed-off-by: Daniel Dao <dqminh@cloudflare.com>

* dockerfile: bump golang to 1.7.1
This commit is contained in:
Daniel, Dao Quang Minh
2016-10-07 10:14:46 -07:00
committed by Kyle Isom
parent ad1d045520
commit f0610dfd75
4 changed files with 66 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
FROM golang:1.7.1
RUN groupadd -r redoctober --gid=999 && useradd -r -g redoctober --uid=999 redoctober
# grab openssl for generating certs and runit for chpst
RUN apt-get update && \
apt-get install -y openssl runit
COPY . /go/src/github.com/cloudflare/redoctober
RUN go install github.com/cloudflare/redoctober
EXPOSE 8080 8081
ENV RO_CERTS=/var/lib/redoctober/data/server.crt \
RO_KEYS=/var/lib/redoctober/data/server.pem \
RO_DATA=/var/lib/redoctober/data \
RO_CERTPASSWD=password \
RO_COMMONNAME=localhost
ENTRYPOINT ["/go/src/github.com/cloudflare/redoctober/scripts/docker-entrypoint.sh"]
CMD ["redoctober", \
"-addr=:8080", \
"-vaultpath=/var/lib/redoctober/data/diskrecord.json", \
"-certs=/var/lib/redoctober/data/server.crt", \
"-keys=/var/lib/redoctober/data/server.pem"]