docker link

Last login: Mon May 14 11:29:05 on ttys003
bogon:data yons$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED                  STATUS              PORTS                NAMES
c5cf725bdaac        157c62112832        "redis-server /root/r"   Less than a second ago   Up 3 seconds        6379/tcp, 7379/tcp   zen_murdock
bogon:data yons$ docker inspect zen_murdock
[
    {
        "Id": "c5cf725bdaac5834ff568ebc28fac930e23afe8bef184e09890c2a727a389630",
        "Created": "2018-05-14T09:02:06.143668915Z",
        "Path": "redis-server",
        "Args": [
            "/root/redis.conf"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 13586,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2018-05-14T09:02:08.918634535Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:157c62112832d43828a18fa2b2204a2ff3ae18e89f8f8240c3bd46db820e538b",
        "ResolvConfPath": "/var/lib/docker/containers/c5cf725bdaac5834ff568ebc28fac930e23afe8bef184e09890c2a727a389630/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/c5cf725bdaac5834ff568ebc28fac930e23afe8bef184e09890c2a727a389630/hostname",
        "HostsPath": "/var/lib/docker/containers/c5cf725bdaac5834ff568ebc28fac930e23afe8bef184e09890c2a727a389630/hosts",
        "LogPath": "/var/lib/docker/containers/c5cf725bdaac5834ff568ebc28fac930e23afe8bef184e09890c2a727a389630/c5cf725bdaac5834ff568ebc28fac930e23afe8bef184e09890c2a727a389630-json.log",
        "Name": "/zen_murdock",
        "RestartCount": 0,
        "Driver": "aufs",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": null,
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "default",
            "PortBindings": {},
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [],
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": -1,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0
        },
        "GraphDriver": {
            "Name": "aufs",
            "Data": null
        },
        "Mounts": [
            {
                "Name": "dda2e562032e2f77644d89f607fc5471ddb619815291735538cded4b88781774",
                "Source": "/var/lib/docker/volumes/dda2e562032e2f77644d89f607fc5471ddb619815291735538cded4b88781774/_data",
                "Destination": "/data",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            }
        ],
        "Config": {
            "Hostname": "c5cf725bdaac",
            "Domainname": "",
            "User": "",
            "AttachStdin": true,
            "AttachStdout": true,
            "AttachStderr": true,
            "ExposedPorts": {
                "6379/tcp": {},
                "7379/tcp": {}
            },
            "Tty": true,
            "OpenStdin": true,
            "StdinOnce": true,
            "Env": [
                "no_proxy=*.local, 169.254/16",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "REDIS_VERSION=2.8.19",
                "REDIS_DOWNLOAD_URL=http://download.redis.io/releases/redis-2.8.19.tar.gz",
                "REDIS_DOWNLOAD_SHA1=3e362f4770ac2fdbdce58a5aa951c1967e0facc8"
            ],
            "Cmd": [
                "/root/redis.conf"
            ],
            "Image": "157c62112832",
            "Volumes": {
                "/data": {}
            },
            "WorkingDir": "/data",
            "Entrypoint": [
                "redis-server"
            ],
            "OnBuild": null,
            "Labels": {}
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "7bdcdc0c13f32dbda54deab218c66fac5ddd029dedcb35e2f1276f3c7734c0e6",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "6379/tcp": null,
                "7379/tcp": null
            },
            "SandboxKey": "/var/run/docker/netns/7bdcdc0c13f3",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "444b19545e01ad86a623f0774ac5be2204d6d93dd4a94ef8df2a8e8978cc7f3b",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:02",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "00dc04b3693bb0fa60337776a8647e5631befd42812705593c7421a21c4032cc",
                    "EndpointID": "444b19545e01ad86a623f0774ac5be2204d6d93dd4a94ef8df2a8e8978cc7f3b",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:02"
                }
            }
        }
    }
]
bogon:data yons$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                NAMES
c5cf725bdaac        157c62112832        "redis-server /root/r"   About a minute ago   Up About a minute   6379/tcp, 7379/tcp   zen_murdock
bogon:data yons$ netstat -na|grep 6379
bogon:data yons$ netstat -na|grep 7379
bogon:data yons$ docker pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
a48c500ed24e: Downloading [=====>                                             ] 3.108 MB/30.96 MB
1e1de00ff7e1: Download complete
0330ca45a200: Download complete
471db38bcfbf: Download complete
0b4aba487617: Download complete
^C
bogon:data yons$ docker image
docker: 'image' is not a docker command.
See 'docker --help'.
bogon:data yons$ docker images
REPOSITORY                          TAG                 IMAGE ID            CREATED             SIZE
dayun_mysql                         latest              180a9fb43a3f        2 hours ago         383.4 MB
nginx_docker                        latest              0918af3099f5        3 hours ago         475.5 MB
arwawa                              latest              eab6dcb7b959        3 hours ago         1.235 GB
dayun_redis                         latest              157c62112832        3 hours ago         110.8 MB
redis                               latest              bfcb1f6df2db        12 days ago         106.7 MB
redis                               3.2                 e97b1f10d81a        12 days ago         99.71 MB
ubuntu                              latest              c9d990395902        4 weeks ago         112.9 MB
hello-world                         latest              e38bc07ac18e        4 weeks ago         1.848 kB
redis                               <none>              b05c3d76c8b3        8 weeks ago         99.71 MB
mongo                               3.4.10              e905a87e116d        4 months ago        359.6 MB
webdevops/php-nginx                 latest              eb5a089deb65        7 months ago        511.8 MB
daocloud.io/dayun_server/python36   centos7             07c69d56d290        7 months ago        741.3 MB
ubuntu                              12.04               5b117edd0b76        13 months ago       103.6 MB
mysql                               5.7.16              d9124e6c552f        17 months ago       383.4 MB
kitsudo/aliyun_centos6.6            latest              dd4cbef79aef        18 months ago       251.4 MB
redis                               3.2.3               d017c068a149        19 months ago       182.9 MB
redis                               2.8.19              dd9fe7db5236        3 years ago         110.8 MB
bogon:data yons$ docker run --rm -it vkitsudo/aliyun_centos6.6
Unable to find image 'vkitsudo/aliyun_centos6.6:latest' locally
^C
bogon:data yons$ docker run --rm -it kitsudo/aliyun_centos6.6
docker: Error response from daemon: No command specified.
See 'docker run --help'.
bogon:data yons$ docker run --rm -it kitsudo/aliyun_centos6.6 bash
[root@e5b35fece2c1 /]# ls
bin  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  sbin  selinux  srv  sys  tmp  usr  var
[root@e5b35fece2c1 /]# exit
bogon:data yons$ docker run --rm --link zen_murdock -it kitsudo/aliyun_centos6.6 bash
[root@fe0a99038202 /]# ping
Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]
            [-p pattern] [-s packetsize] [-t ttl] [-I interface or address]
            [-M mtu discovery hint] [-S sndbuf]
            [ -T timestamp option ] [ -Q tos ] [hop1 ...] destination
[root@fe0a99038202 /]# ping zen_murdock
PING zen_murdock (172.17.0.2) 56(84) bytes of data.
64 bytes from zen_murdock (172.17.0.2): icmp_seq=1 ttl=64 time=0.097 ms
64 bytes from zen_murdock (172.17.0.2): icmp_seq=2 ttl=64 time=0.052 ms
64 bytes from zen_murdock (172.17.0.2): icmp_seq=3 ttl=64 time=0.045 ms
^C
--- zen_murdock ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2800ms
rtt min/avg/max/mdev = 0.045/0.064/0.097/0.024 ms
[root@fe0a99038202 /]# telnet
bash: telnet: command not found
[root@fe0a99038202 /]# yum install -y telnet
Setting up Install Process
base                                                                                                                             | 3.7 kB     00:00    
base/primary_db                                                                                                                  | 4.7 MB     00:04    
epel                                                                                                                             | 4.7 kB     00:00    
epel/primary_db                                                                                                                  | 6.0 MB     00:06    
extras                                                                                                                           | 3.4 kB     00:00    
extras/primary_db                                                                                                                |  30 kB     00:00    
updates                                                                                                                          | 3.4 kB     00:00    
updates/primary_db                                                                                                               | 7.5 MB     00:06    
Resolving Dependencies
--> Running transaction check
---> Package telnet.x86_64 1:0.17-48.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================
 Package                            Arch                               Version                                   Repository                        Size
========================================================================================================================================================
Installing:
 telnet                             x86_64                             1:0.17-48.el6                             base                              58 k

Transaction Summary
========================================================================================================================================================
Install       1 Package(s)

Total download size: 58 k
Installed size: 109 k
Downloading Packages:
telnet-0.17-48.el6.x86_64.rpm                                                                                                    |  58 kB     00:00    
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
 Userid: "CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>"
 From  : http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:telnet-0.17-48.el6.x86_64                                                                                                          1/1
  Verifying  : 1:telnet-0.17-48.el6.x86_64                                                                                                          1/1

Installed:
  telnet.x86_64 1:0.17-48.el6                                                                                                                          

Complete!
[root@fe0a99038202 /]# telnet zen_murdock 6379
Trying 172.17.0.2...
telnet: connect to address 172.17.0.2: Connection refused
[root@fe0a99038202 /]# telnet zen_murdock 7379
Trying 172.17.0.2...
Connected to zen_murdock.
Escape character is '^]'.
^]
telnet> Connection closed.
[root@fe0a99038202 /]# yum install -y redis
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package redis.x86_64 0:3.2.11-1.el6 will be installed
--> Processing Dependency: logrotate for package: redis-3.2.11-1.el6.x86_64
--> Processing Dependency: libjemalloc.so.1()(64bit) for package: redis-3.2.11-1.el6.x86_64
--> Running transaction check
---> Package jemalloc.x86_64 0:3.6.0-1.el6 will be installed
---> Package logrotate.x86_64 0:3.7.8-28.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================
 Package                              Arch                              Version                                   Repository                       Size
========================================================================================================================================================
Installing:
 redis                                x86_64                            3.2.11-1.el6                              epel                            521 k
Installing for dependencies:
 jemalloc                             x86_64                            3.6.0-1.el6                               epel                            100 k
 logrotate                            x86_64                            3.7.8-28.el6                              base                             59 k

Transaction Summary
========================================================================================================================================================
Install       3 Package(s)

Total download size: 680 k
Installed size: 1.7 M
Downloading Packages:
(1/3): jemalloc-3.6.0-1.el6.x86_64.rpm                                                                                           | 100 kB     00:00    
(2/3): logrotate-3.7.8-28.el6.x86_64.rpm                                                                                         |  59 kB     00:00    

(3/3): redis-3.2.11-1.el6.x86_64.rpm                                                                                             | 521 kB     00:00    
--------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                   115 kB/s | 680 kB     00:05    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction

  Installing : logrotate-3.7.8-28.el6.x86_64                                                                                                        1/3



  Installing : jemalloc-3.6.0-1.el6.x86_64                                                                                                          2/3



  Installing : redis-3.2.11-1.el6.x86_64                                                                                                            3/3



  Verifying  : jemalloc-3.6.0-1.el6.x86_64                                                                                                          1/3
  Verifying  : redis-3.2.11-1.el6.x86_64                                                                                                            2/3
  Verifying  : logrotate-3.7.8-28.el6.x86_64                                                                                                        3/3





Installed:
  redis.x86_64 0:3.2.11-1.el6                                                                                                                          

Dependency Installed:
  jemalloc.x86_64 0:3.6.0-1.el6                                             logrotate.x86_64 0:3.7.8-28.el6                                           

Complete!
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]#
[root@fe0a99038202 /]# redis-cli -h zen_murdock
Could not connect to Redis at zen_murdock:6379: Connection refused
Could not connect to Redis at zen_murdock:6379: Connection refused
not connected>
[root@fe0a99038202 /]# redis-cli -h zen_murdock -p 7379
zen_murdock:7379> info
# Server
redis_version:2.8.19
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:e7873c849a0397f9
redis_mode:standalone
os:Linux 4.4.27-moby x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.7.2
process_id:1
run_id:abcc28d1697733ad16a4ecbcc1ceb8c70208359f
tcp_port:7379
uptime_in_seconds:327
uptime_in_days:0
hz:10
lru_clock:16339415
config_file:/root/redis.conf

# Clients
connected_clients:1
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0

# Memory
used_memory:810808
used_memory_human:791.80K
used_memory_rss:3657728
used_memory_peak:810808
used_memory_peak_human:791.80K
used_memory_lua:35840
mem_fragmentation_ratio:4.51
mem_allocator:jemalloc-3.6.0

# Persistence
loading:0
rdb_changes_since_last_save:0
rdb_bgsave_in_progress:0
rdb_last_save_time:1526288528
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:-1
rdb_current_bgsave_time_sec:-1
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok

# Stats
total_connections_received:2
total_commands_processed:1
instantaneous_ops_per_sec:0
total_net_input_bytes:31
total_net_output_bytes:722235
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:0
evicted_keys:0
keyspace_hits:0
keyspace_misses:0
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:0

# Replication
role:master
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

# CPU
used_cpu_sys:0.25
used_cpu_user:0.10
used_cpu_sys_children:0.00
used_cpu_user_children:0.00

# Keyspace
zen_murdock:7379> clients
(error) ERR unknown command 'clients'
zen_murdock:7379> client
(error) ERR wrong number of arguments for 'client' command
zen_murdock:7379> CLIENT LIST
id=3 addr=172.17.0.3:46792 fd=6 name= age=11 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client
zen_murdock:7379>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值