Explorar o código

docker stage separation: build & runtime

Fabian Peter Hammerle %!s(int64=6) %!d(string=hai) anos
pai
achega
8e6a59c990
Modificáronse 1 ficheiros con 15 adicións e 2 borrados
  1. 15 2
      Dockerfile

+ 15 - 2
Dockerfile

@@ -8,11 +8,24 @@ RUN apk add --no-cache \
     make \
     pkgconf
 
-RUN apk add --no-cache fuse `# convenient`
-
 RUN adduser -S build
 USER build
 
 COPY --chown=build:nogroup . /rgpgfs
 WORKDIR /rgpgfs
 RUN make
+
+
+FROM alpine:3.9
+
+RUN apk add --no-cache \
+    fuse3 \
+    gpgme
+
+# optional, contains fusermount
+RUN apk add --no-cache fuse
+
+RUN adduser -S encrypt
+USER encrypt
+
+COPY --from=build /rgpgfs/rgpgfs /usr/local/bin/