Browse Source

added script 'ipfs-daemon' to fix $IPFS_INIT_PROFILE not being resolved

Fabian Peter Hammerle 5 years ago
parent
commit
b0adf7c91a
2 changed files with 11 additions and 1 deletions
  1. 4 1
      Dockerfile
  2. 7 0
      ipfs-daemon

+ 4 - 1
Dockerfile

@@ -23,9 +23,12 @@ RUN wget -O- https://dist.ipfs.io/go-ipfs/v${IPFS_VERSION}/go-ipfs_v${IPFS_VERSI
     && mv /tmp/go-ipfs/ipfs /usr/local/bin \
     && rm -r /tmp/go-ipfs
 
+COPY ./ipfs-daemon /usr/local/bin/ipfs-daemon
+RUN chmod a=rx /usr/local/bin/ipfs-daemon
+
 USER ipfs
 EXPOSE 4001/tcp
 # ipfs http gateway
 EXPOSE 8080/tcp
 ENV IPFS_INIT_PROFILE server
-CMD ["ipfs", "daemon", "--init", "--init-profile", "$IPFS_INIT_PROFILE"]
+CMD ["ipfs-daemon"]

+ 7 - 0
ipfs-daemon

@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ ! -e "$IPFS_PATH/config" ]; then
+    (set -x; ipfs init --profile $IPFS_INIT_PROFILE)
+fi
+
+exec ipfs daemon