Skip to content

Commit f7f1d74

Browse files
authored
Document config initialization with envs
Documentation of feature from ipfs/kubo#8326
1 parent 2050409 commit f7f1d74

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/how-to/run-ipfs-inside-docker.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,20 @@ When starting a container running ipfs for the first time with an empty data dir
6464
```shell
6565
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
6666
```
67+
## Environmet override
68+
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`
69+
70+
For example:
71+
```shell
72+
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
73+
```
74+
75+
Some important notes:
76+
- The names are case sensitive. `IPFSCONFIG_FooBar=true` and `IPFSCONFIG_foobar=true` are not the same
77+
- Arrays must use escaped double quotes, like `IPFSCONFIG_FooBar=[\"test\"]`
78+
- Syntactically valid config will **not** cause any error, even if it does anything. `IPFSCONFIG_zzz_abcds=true` wil be written to the config
79+
- Invalid variables will be ignored, like `IPFSCONFIG_foobar_=true`
80+
- Invalid values will faill initialization, like `IPFSCONFIG_foobar=trues`
6781

6882
## Private swarms inside Docker
6983

0 commit comments

Comments
 (0)