首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

docker-compose exec

代码语言:javascript
复制
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获得交互式提示。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com