Skip to content

Commit

Permalink
Explicit volume for docker
Browse files Browse the repository at this point in the history
Creating a /var/lib/katafygio/data dir owned by the container's user,
and declaring the parent dir (/var/lib/katafygio) as a volume, Docker
will copy the (correctly owned) "data" sub-dir at each launch ; which
ensure we can write to this directory. Even when the volume is created
and mounted by Kubernetes.

This image can be used with --local-dir=/var/lib/katafygio/data .
  • Loading branch information
bpineau committed May 13, 2018
1 parent b85b4c9 commit ef7eeaf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ RUN make build

FROM alpine:3.7
RUN apk upgrade --no-cache && apk --no-cache add ca-certificates git
RUN install -d -o nobody -g nobody /var/lib/katafygio/data
COPY --from=builder /go/src/github.com/bpineau/katafygio/katafygio /usr/bin/
VOLUME /var/lib/katafygio
USER nobody
ENTRYPOINT ["/usr/bin/katafygio"]
2 changes: 2 additions & 0 deletions assets/Dockerfile.goreleaser
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM alpine:3.7
RUN apk upgrade --no-cache && apk --no-cache add ca-certificates git
RUN install -d -o nobody -g nobody /var/lib/katafygio/data
COPY katafygio /usr/bin/
VOLUME /var/lib/katafygio
USER nobody
ENTRYPOINT ["/usr/bin/katafygio"]

0 comments on commit ef7eeaf

Please sign in to comment.