docker-compose
文章目录
简介
|
|
常见参数
command:这里的书写方式支持多种,是等效的,我就是使用第三个书写方法。
-
直接一行字符串,这就是我们正常使用的例如 command: bundle exec thin -p 3000
1
command: "/usr/local/bin/etcd --name s1 --data-dir /etcd-data --advertise-client-urls http://0.0.0.0:2379 --listen-client-urls http://0.0.0.0:2379 --initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380 --initial-cluster-token tkn --initial-cluster s1=http://0.0.0.0:2380 --initial-cluster-state new"
-
方括号数组方式,例如 command: [bundle, exec, thin, -p, 3000]
1
command: ["/usr/local/bin/etcd", "--name", "s1", "--data-dir", "/etcd-data" "--advertise-client-urls", "http://0.0.0.0:2379", "--listen-client-urls", "http://0.0.0.0:2379", "--initial-advertise-peer-urls", "http://0.0.0.0:2380", "--listen-peer-urls", "http://0.0.0.0:2380", "--initial-cluster-token", "tkn", "--initial-cluster", "s1=http://0.0.0.0:2380", "--initial-cluster-state", "new"]
-
yaml 数组方式,例如:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
command: - "/usr/local/bin/etcd" - "--name"· - "s1" - "--data-dir" - "/etcd-data" - "--advertise-client-urls" - "http://0.0.0.0:2379" - --listen-client-urls - "http://0.0.0.0:2379" - "--initial-advertise-peer-urls" - "http://0.0.0.0:2380" - "--listen-peer-urls" - "http://0.0.0.0:2380" - "--initial-cluster-token" - "tkn" - "--initial-cluster" - "s1=http://0.0.0.0:2380" - "--initial-cluster-state" - "new"