Docker 17参考手册
撰写 | Compose
docker-compose exec
Usage: exec [options] SERVICE COMMAND [ARGS...]
Options:
-d Detached mode: Run command in the background.
--privileged Give extended privileges to the process.
-u, --user USER Run the command as this user.
-T Disable pseudo-tty allocation. By default `docker-compose exec`
allocates a TTY.
--index=index index of the container if there are multiple
instances of a service [default: 1]
这相当于docker exec
。使用此子命令,您可以在服务中运行任意命令。命令默认分配一个 TTY ,所以你可以做例如docker-compose exec web sh
获得交互式提示。
fig, composition, compose, docker, orchestration, cli, exec
撰写 | Compose相关
Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。容器是完全使用沙箱机制,相互之间不会有任何接口。
主页 | https://docker.com/ |
源码 | https://github.com/docker/docker |
版本 | 17 |
发布版本 | 17.06 |