Revert "Really run as non-root user in docker container"
Hector Sanjuan committed
Mar 3, 2019 at 16:20 UTC
9f74e12103596f2aed0bf50171289d3e1f9eb295
2 files changed
+2
-9
Dockerfile
+1
-4
@@ -60,15 +60,12 @@ EXPOSE 8080
60
# Swarm Websockets; must be exposed publicly when the node is listening using the websocket transport (/ipX/.../tcp/8081/ws).
61
EXPOSE 8081
62
63
-# Create the fs-repo directory
63
+# Create the fs-repo directory and switch to a non-privileged user.
64
ENV IPFS_PATH /data/ipfs
65
RUN mkdir -p $IPFS_PATH \
66
&& adduser -D -h $IPFS_PATH -u 1000 -G users ipfs \
67
&& chown ipfs:users $IPFS_PATH
68
69
-# Switch to a non-privileged user
70
-USER ipfs
71
-
69
# Expose the fs-repo as a volume.
70
# start_ipfs initializes an fs-repo if none is mounted.
71
# Important this happens after the USER directive so permission are correct.
Dockerfile.fast
+1
-5
@@ -53,18 +53,14 @@ EXPOSE 5001
53
EXPOSE 8080
54
EXPOSE 8081
55
56
-# Create the fs-repo directory
56
+# Create the fs-repo directory and switch to a non-privileged user.
57
ENV IPFS_PATH /data/ipfs
58
RUN mkdir -p $IPFS_PATH \
59
&& useradd -s /usr/sbin/nologin -d $IPFS_PATH -u 1000 -G users ipfs \
60
&& chown ipfs:users $IPFS_PATH
61
62
-# Switch to a non-privileged user
63
-USER ipfs
64
-
62
# Expose the fs-repo as a volume.
63
# start_ipfs initializes an fs-repo if none is mounted.
67
-# Important this happens after the USER directive so permission are correct.
64
VOLUME $IPFS_PATH
65
66
# The default logging level