docker_practice/swarm_mode/config.md

55 lines
1.9 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Swarm
volume
Docker 17.06 Docker `docker config`
>`config` Swarm 使
Swarm `redis`
## config
`redis.conf`
```bash
port 6380
```
Redis `6380`
使 `docker config create` `config`
```bash
$ docker config create redis.conf redis.conf
```
## config
使 `docker config ls` `config`
```bash
$ docker config ls
ID NAME CREATED UPDATED
yod8fx8iiqtoo84jgwadp86yk redis.conf 4 seconds ago 4 seconds ago
```
## redis
```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`