docker usage

docker ps -a

查看物理机上面所有容器信息列表

 

docker exec -it $docker_id /bin/bash

进入容器以默认帐号

 

docker exec -it -u root $docker_id /bin/bash

进入容器以指定帐号

 

docker cp $src_file_path $docker_id:$dst_file_path

把物理机上文件或文件件拷贝到容器中

 

docker cp $docker_id:$src_file_path $dst_file_path

把容器中文件或文件夹拷贝到物理机

 

docker restart $docker_id

重启指定容器

 

docker init $docker_image_id

初始化构建容器以指定镜像(待确认)

 

docker exec -it $docker_id ifconfig

不进入容器情况下执行命令“ifconfig”,查看容器内网卡情况。

转载于:https://www.cnblogs.com/zwgtx/p/9350370.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Error: Invalid usage: unknown subcommand: `docder` xiaohei@xiaoheideMacBook-Pro ~ % brew services start docder Error: No available formula with the name "docder". Did you mean docker? xiaohei@xiaoheideMacBook-Pro ~ % sudo brew services start docder Error: No available formula with the name "docder". Did you mean docker? xiaohei@xiaoheideMacBook-Pro ~ % sudo brew services restart docder Error: No available formula with the name "docder". Did you mean docker? xiaohei@xiaoheideMacBook-Pro ~ % docker -v Docker version 24.0.2, build cb74dfcd85 xiaohei@xiaoheideMacBook-Pro ~ % sudo brew services restart docder Error: No available formula with the name "docder". Did you mean docker? xiaohei@xiaoheideMacBook-Pro ~ % sudo brew services list Name Status User File nginx started root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist php@7.4 started root /Library/LaunchDaemons/homebrew.mxcl.php@7.4.plist xiaohei@xiaoheideMacBook-Pro ~ % sudo brew services docker Usage: brew services [subcommand] Manage background services with macOS' launchctl(1) daemon manager. If sudo is passed, operate on /Library/LaunchDaemons (started at boot). Otherwise, operate on ~/Library/LaunchAgents (started at login). [sudo] brew services [list] (--json): List information about all managed services for the current user (or root). [sudo] brew services info (formula|--all|--json): List all managed services for the current user (or root). [sudo] brew services run (formula|--all): Run the service formula without registering to launch at login (or boot). [sudo] brew services start (formula|--all|--file=): Start the service formula immediately and register it to launch at login (or boot). [sudo] brew services stop (formula|--all): Stop the service formula immediately and unregister it from launching at login (or boot). [sudo] brew services kill (formula|--all): Stop the service formula immediately but keep it registered to launch at login (or boot). [sudo] brew services restart (formula|--all): Stop (if necessary) and start the service formula immediately and register it to launch at login (or boot). [sudo] brew services cleanup: Remove all unused services. --file Use the service file from this location to start the service. --all Run subcommand on all services. --json Output as JSON. -d, --debug Display any debugging information. -q, --quiet Make some output more quiet. -v, --verbose Make some output more verbose. -h, --help Show this message. Error: Invalid usage: unknown subcommand: `docker` xiaohei@xiaoheideMacBook-Pro ~ % brew services restart docker Error: Formula `docker` has not implemented #plist, #service or installed a locatable service file xiaohei@xiaoheideMacBook-Pro ~ % docker ps Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? xiaohei@xiaoheideMacBook-Pro ~ % docker images Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? xiaohei@xiaoheideMacBook-Pro ~ % brew services start docker Error: Formula `docker` has not implemented #plist, #service or installed a locatable service file xiaohei@xiaoheideMacBook-Pro ~ % 帮我看下错误
06-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值