Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

Commit

Permalink
Fix Dockerfile and add note about non-persisting gopath
Browse files Browse the repository at this point in the history
  • Loading branch information
lasley committed Jan 2, 2017
1 parent 7bca20b commit d14d4cd
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 13 deletions.
5 changes: 5 additions & 0 deletions clouder_template_red_october/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ Known issues / Roadmap

* The service is currently using a self-signed certificate. This should be changed once a CA exists.
* Runit is being installed via community repos, which are HTTP only. This is insecure.
* Path isn't persisting so there is a symlink to redoctober being created. This should be fixed at some point,
likely in a base Go container instead of here.
* Image volume is being mounted as root, then chown is happening in the docker entrypoint. This sseems weird,
so should investigate further, but is how the CloudFlare people rigged it up so it's possible they're simply
smarter than me.

Bug Tracker
===========
Expand Down
4 changes: 2 additions & 2 deletions clouder_template_red_october/data/image_port.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<field name="local_port">8080</field>
</record>

<record id="image_port_redoctober_comm"
<record id="image_port_redoctober_metrics"
model="clouder.image.port"
>
<field name="template_id" ref="image_template_redoctober_exec" />
<field name="name">comm</field>
<field name="name">metrics</field>
<field name="local_port">8081</field>
</record>

Expand Down
2 changes: 1 addition & 1 deletion clouder_template_red_october/data/image_volume.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<field name="template_id" ref="image_template_redoctober_data" />
<field name="name">data</field>
<field name="localpath">/var/lib/redoctober/data</field>
<field name="user">redoctober</field>
<field name="user">root</field>
</record>

</odoo>
33 changes: 23 additions & 10 deletions clouder_template_red_october/images/exec/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
FROM clouder/base:3.4
MAINTAINER Dave Lasley <[email protected]>

ARG RO_CERTPASSWD="password"
ARG RO_COMMONNAME="localhost"

RUN addgroup -S redoctober \
&& adduser -S -g redoctober redoctober

Expand All @@ -19,18 +22,28 @@ RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /et
RUN apk add --no-cache $buildDeps

# Install Red October
RUN git clone --depth=1 https://github.com/cloudflare/redoctober.git /usr/lib/go/src/github.com/cloudflare/redoctober
RUN go install github.com/cloudflare/redoctober
RUN git clone --depth=1 https://github.com/cloudflare/redoctober.git /usr/lib/go/src/github.com/cloudflare/redoctober \
&& go install github.com/cloudflare/redoctober

ENV GOROOT="/usr/lib/go" \
GOPATH="/gopath" \
GOBIN="/gopath/bin" \
PATH="$PATH:$GOROOT/bin:$GOPATH/bin"

# Path isn't persisting for some reason.
RUN ln -s "$GOROOT/bin/redoctober" /usr/bin

# Setup Environment
ENV RO_DATA=/var/lib/redoctober/data \
RO_CERTS=$RO_DATA/server.crt \
RO_KEYS=$RO_DATA/server.pem
ENV RO_DATA="/var/lib/redoctober/data"
ENV RO_CERTS="${RO_DATA}/server.crt" \
RO_KEYS="${RO_DATA}/server.pem" \
RO_CERTPASSWD="${RO_CERTPASSWD}" \
RO_COMMONNAME="${RO_COMMONNAME}"

ENTRYPOINT ["/go/src/github.com/cloudflare/redoctober/scripts/docker-entrypoint.sh"]
ENTRYPOINT ["/usr/lib/go/src/github.com/cloudflare/redoctober/scripts/docker-entrypoint.sh"]

CMD ["redoctober", \
"-addr=:8080", \
"-vaultpath=$RO_DATA/diskrecord.json", \
"-certs=$RO_CERTS", \
"-keys=$RO_KEYS"]
"-addr=:8080", \
"-vaultpath=/var/lib/redoctober/data/diskrecord.json", \
"-certs=/var/lib/redoctober/data/server.crt", \
"-keys=/var/lib/redoctober/data/server.pem"]

0 comments on commit d14d4cd

Please sign in to comment.