Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document config initialization with envs #856

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/how-to/run-ipfs-inside-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ When starting a container running ipfs for the first time with an empty data dir
```shell
docker run -d --name ipfs_host -e IPFS_PROFILE=server -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
```
## Environmet override
johnnymatthews marked this conversation as resolved.
Show resolved Hide resolved
You can override the default configuration during the *first* initialization with variables starting with **IPFCONFIG** and *_* as separators, which will be passed directly to `ipfs config`
johnnymatthews marked this conversation as resolved.
Show resolved Hide resolved

For example:
```shell
docker run --rm -e IPFSCONFIG_Swarm_EnableAutoRelay=true -e IPFSCONFIG_Addresses_Swarm=[\"/ip4/0.0.0.0/tcp/4002\",\"/ip6/::/tcp/4002\"] ipfs/go-ipfs:latest
```
johnnymatthews marked this conversation as resolved.
Show resolved Hide resolved

Some important notes:
- The names are case sensitive. `IPFSCONFIG_FooBar=true` and `IPFSCONFIG_foobar=true` are not the same
- Arrays must use escaped double quotes, like `IPFSCONFIG_FooBar=[\"test\"]`
- Syntactically valid config will **not** cause any error, even if it does anything. `IPFSCONFIG_zzz_abcds=true` wil be written to the config
- Invalid variables will be ignored, like `IPFSCONFIG_foobar_=true`
- Invalid values will faill initialization, like `IPFSCONFIG_foobar=trues`
johnnymatthews marked this conversation as resolved.
Show resolved Hide resolved

## Private swarms inside Docker

Expand Down