启动docker,进入docker

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/DDFFR/article/details/75504476
[root@i-k11xnd1o ~]# docker images
REPOSITORY                              TAG                 IMAGE ID            CREATED             SIZE
docker.io/hello-world                   latest              1815c82652c0        5 weeks ago         1.84 kB
docker.io/blockchain101/ethereum-geth   1.6.5               1e23e07389b2        5 weeks ago         1.534 GB
[root@i-k11xnd1o ~]# docker run --name hello hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://cloud.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

[root@i-k11xnd1o ~]# docker ps 
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
[root@i-k11xnd1o ~]# docker ps -a
CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS                      PORTS               NAMES
4c7a7f772b51        hello-world                         "/hello"                 22 seconds ago      Exited (0) 21 seconds ago                       hello
afffac98fb68        blockchain101/ethereum-geth:1.6.5   "bash -c './rungeth.s"   17 hours ago        Exited (137) 16 hours ago                       geth-cluster0
92a18adb1acd        blockchain101/ethereum-geth:1.6.5   "bash -c './checkboot"   17 hours ago        Exited (137) 16 hours ago                       geth-cluster1
2efa9f365613        hello-world                         "/hello"                 23 hours ago        Exited (0) 23 hours ago                         furious_keller
[root@i-k11xnd1o ~]# docker start afffac98fb68
afffac98fb68
[root@i-k11xnd1o ~]# docker ps 
CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS              PORTS                              NAMES
afffac98fb68        blockchain101/ethereum-geth:1.6.5   "bash -c './rungeth.s"   17 hours ago        Up 7 seconds        0.0.0.0:8200-8210->8200-8210/tcp   geth-cluster0

启动容器以后就自动进去容器的目录了

[root@i-k11xnd1o ~]#docker exec -it afffac98fb68 /bin/bash
root@afffac98fb68:/ethutil# ll
total 32
drwxrwxrwx  2 root root  165 Jun 11 15:36 ./
drwxr-xr-x 25 root root  322 Jul 20 02:31 ../
-rwxrwxrwx  1 root root   88 Jun 11 07:00 checkbootnode.sh*
-rwxrwxrwx  1 root root 1282 Jun  9 14:26 gethaccts.sh*
-rwxrwxrwx  1 root root 2527 Jun  9 15:08 gethcluster.sh*
-rwxrwxrwx  1 root root 2759 Jun 11 15:30 gethnodes.sh*
-rwxrwxrwx  1 root root 3230 Jun 10 06:56 gethup.sh*
-rwxrwxrwx  1 root root  200 Jun  9 14:26 killgeth.sh*
-rwxrwxrwx  1 root root   45 Jun  9 14:26 nodeinfo.js*
-rwxrwxrwx  1 root root 1415 Jun 11 15:34 rungeth.sh*
展开阅读全文

没有更多推荐了,返回首页