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

Commit 75d47c3

Browse files
JGAntunesdaviddias
authored andcommitted
fix: docker init script sed in non existent file (#1246)
1 parent 0950f6a commit 75d47c3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Diff for: Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ENV IPFS_WRTC_LINUX_WINDOWS=1
77
ENV IPFS_BOOTSTRAP=1
88
ENV IPFS_MONITORING=1
99
ENV IPFS_PATH=/root/.jsipfs
10+
ENV IPFS_API_HOST=0.0.0.0
1011

1112
ENV BUILD_DEPS='libnspr4 libnspr4-dev libnss3'
1213

Diff for: init-and-daemon.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
set -e
44

5-
if [ -n $IPFS_PATH ]; then
5+
if [ -n "$IPFS_PATH" ]; then
66
echo "Using $IPFS_PATH as IPFS repository"
77
else
88
echo "You need to set IPFS_PATH environment variable to use this script"
99
exit 1
1010
fi
1111

12-
sed -i.bak 's/127.0.0.1/0.0.0.0/g' $IPFS_PATH/config
13-
1412
# Initialize the repo but ignore if error if it already exists
1513
# This can be the case when we restart a container without stopping/removing it
1614
node src/cli/bin.js init || true
1715

16+
if [ -n "$IPFS_API_HOST" ]; then
17+
sed -i.bak "s/127.0.0.1/$IPFS_API_HOST/g" $IPFS_PATH/config
18+
fi
19+
1820
node src/cli/bin.js daemon

0 commit comments

Comments
 (0)