美文网首页
学习 docker

学习 docker

作者: 吴宪峰 | 来源:发表于2019-10-16 11:47 被阅读0次

If you only have a single docker machine, you simply do:
如果你只有一个实例运行下面的命令就可以进入default主机

$ docker-machine ssh

If you have multiple machines, you need to find your "machine name" first:
如果你有多个实例,运行下面的命令先找到你的主机名 “machine name”

$ docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
default   *        virtualbox   Running   tcp://192.168.99.101:2376           v1.10.2 

From the above, you can see that default is the name of your machine and you can ssh as follows:
从上面你可以看到default是你的主机名,你可以ssh到主机用下面的

$ docker-machine ssh default

When you're in, it's a simple case of sudo-ing to root
你进入主机后,进入root账户用以下命令

docker@default:~$ sudo -i
Boot2Docker version 1.10.2, build master : 611be10 - Mon Feb 22 22:47:06 UTC 2016
Docker version 1.10.2, build c3959b1
root@default:~# 

Edited: Also, as @MediaVince mentioned you can use the following credentials:

user: docker
pwd: tcuser

相关文章

网友评论

      本文标题:学习 docker

      本文链接:https://www.haomeiwen.com/subject/dwbymctx.html