Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: docker init script sed in non existent file (#1246)
Browse files Browse the repository at this point in the history
  • Loading branch information
JGAntunes authored and daviddias committed Mar 16, 2018
1 parent 0950f6a commit 75d47c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ENV IPFS_WRTC_LINUX_WINDOWS=1
ENV IPFS_BOOTSTRAP=1
ENV IPFS_MONITORING=1
ENV IPFS_PATH=/root/.jsipfs
ENV IPFS_API_HOST=0.0.0.0

ENV BUILD_DEPS='libnspr4 libnspr4-dev libnss3'

Expand Down
8 changes: 5 additions & 3 deletions init-and-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

set -e

if [ -n $IPFS_PATH ]; then
if [ -n "$IPFS_PATH" ]; then
echo "Using $IPFS_PATH as IPFS repository"
else
echo "You need to set IPFS_PATH environment variable to use this script"
exit 1
fi

sed -i.bak 's/127.0.0.1/0.0.0.0/g' $IPFS_PATH/config

# Initialize the repo but ignore if error if it already exists
# This can be the case when we restart a container without stopping/removing it
node src/cli/bin.js init || true

if [ -n "$IPFS_API_HOST" ]; then
sed -i.bak "s/127.0.0.1/$IPFS_API_HOST/g" $IPFS_PATH/config
fi

node src/cli/bin.js daemon

0 comments on commit 75d47c3

Please sign in to comment.