docker_practice/swarm_mode/config.md

55 lines
1.9 KiB
Go
Raw Normal View History

# Swarm
2017-12-08 19:15:27 +08:00
volume
Docker 17.06 Docker `docker config`
2017-12-20 23:44:38 +08:00
>`config` Swarm 使
2017-12-08 19:15:27 +08:00
Swarm `redis`
## config
2017-12-08 19:15:27 +08:00
`redis.conf`
```bash
port 6380
```
Redis `6380`
使 `docker config create` `config`
```bash
$ docker config create redis.conf redis.conf
```
## config
2017-12-08 19:15:27 +08:00
2017-12-11 17:44:48 +08:00
使 `docker config ls` `config`
2017-12-08 19:15:27 +08:00
```bash
2017-12-11 17:44:48 +08:00
$ docker config ls
2017-12-08 19:15:27 +08:00
ID NAME CREATED UPDATED
yod8fx8iiqtoo84jgwadp86yk redis.conf 4 seconds ago 4 seconds ago
```
## redis
2017-12-08 19:15:27 +08:00
```bash
$ docker service create \
--name redis \
# --config source=redis.conf,target=/etc/redis.conf \
--config redis.conf \
-p 6379:6380 \
redis:latest \
redis-server /redis.conf
```
`target` `redis.conf` `tmpfs` `/config.conf`
redis 使
Redis `docker config` `config`