Commit df7c1fcc authored by Antti Kaihola's avatar Antti Kaihola

docker: allow IPFS_PROFILE to choose the profile for `ipfs init`

License: MIT
Signed-off-by: default avatarAntti Kaihola <antti+ipfs@kaihola.fi>
parent 99628170
...@@ -317,6 +317,10 @@ Stop the running container: ...@@ -317,6 +317,10 @@ Stop the running container:
docker stop ipfs_host docker stop ipfs_host
When starting a container running ipfs for the first time with an empty data directory, it will call `ipfs init` to initialize configuration files and generate a new keypair. At this time, you can choose which profile to apply using the `IPFS_PROFILE` environment variable:
docker run -d --name ipfs_host -e IPFS_PROFILE=server -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
### Troubleshooting ### Troubleshooting
If you have previously installed IPFS before and you are running into problems getting a newer version to work, try deleting (or backing up somewhere else) your IPFS config directory (~/.ipfs by default) and rerunning `ipfs init`. This will reinitialize the config file to its defaults and clear out the local datastore of any bad entries. If you have previously installed IPFS before and you are running into problems getting a newer version to work, try deleting (or backing up somewhere else) your IPFS config directory (~/.ipfs by default) and rerunning `ipfs init`. This will reinitialize the config file to its defaults and clear out the local datastore of any bad entries.
......
...@@ -17,7 +17,11 @@ ipfs version ...@@ -17,7 +17,11 @@ ipfs version
if [ -e "$repo/config" ]; then if [ -e "$repo/config" ]; then
echo "Found IPFS fs-repo at $repo" echo "Found IPFS fs-repo at $repo"
else else
ipfs init case $IPFS_PROFILE in
"") INIT_ARGS= ;;
*) INIT_ARGS=--profile=$IPFS_PROFILE ;;
esac
ipfs init $INIT_ARGS
ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001 ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080 ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment