前言
command在docker中的使用方法
使用场景
docker-compose
- 法一
version: "3.5"
services:
monitor:
image: firmament/monitor:monitorfinancemachine
container_name: monitor
hostname: monitor
command: ["/bin/sh", "-c", "crond"]
restart: always
tty: true
- 法二
version: "3.5"
services:
monitor:
image: firmament/monitor:monitorfinancemachine
container_name: monitor
hostname: monitor
command:
- /bin/sh
- -c
- crond
restart: always
tty: true
补充
command中执行多条命令
command:
- /bin/sh
- -c
- |
crond
date
结语
… …