Skip to content

Commit ef7eeaf

Browse files
committed
Explicit volume for docker
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 .
1 parent b85b4c9 commit ef7eeaf

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ RUN make build
77

88
FROM alpine:3.7
99
RUN apk upgrade --no-cache && apk --no-cache add ca-certificates git
10+
RUN install -d -o nobody -g nobody /var/lib/katafygio/data
1011
COPY --from=builder /go/src/github.com/bpineau/katafygio/katafygio /usr/bin/
12+
VOLUME /var/lib/katafygio
1113
USER nobody
1214
ENTRYPOINT ["/usr/bin/katafygio"]

assets/Dockerfile.goreleaser

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM alpine:3.7
22
RUN apk upgrade --no-cache && apk --no-cache add ca-certificates git
3+
RUN install -d -o nobody -g nobody /var/lib/katafygio/data
34
COPY katafygio /usr/bin/
5+
VOLUME /var/lib/katafygio
46
USER nobody
57
ENTRYPOINT ["/usr/bin/katafygio"]

0 commit comments

Comments
 (0)