Browse Source

convert cmd wrapper to entrypoint

Fabian Peter Hammerle 5 years ago
parent
commit
fa6cca1e8e
2 changed files with 6 additions and 5 deletions
  1. 5 4
      Dockerfile
  2. 1 1
      entrypoint.sh

+ 5 - 4
Dockerfile

@@ -23,12 +23,13 @@ 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
+ENV IPFS_INIT_PROFILE server
+COPY entrypoint.sh /
+RUN chmod a=rx /entrypoint.sh
+ENTRYPOINT ["/entrypoint.sh"]
 
 USER ipfs
 EXPOSE 4001/tcp
 # ipfs http gateway
 EXPOSE 8080/tcp
-ENV IPFS_INIT_PROFILE server
-CMD ["ipfs-daemon"]
+CMD ["ipfs", "daemon"]

+ 1 - 1
ipfs-daemon → entrypoint.sh

@@ -4,4 +4,4 @@ if [ ! -e "$IPFS_PATH/config" ]; then
     (set -x; ipfs init --profile $IPFS_INIT_PROFILE)
 fi
 
-exec ipfs daemon
+exec "$@"