国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專欄INFORMATION COLUMN

Docker容器技術(shù)實戰(zhàn)

endless_road / 2533人閱讀

docker基礎(chǔ)

linux namespace機制可參考:http://www.infoq.com/cn/artic...
linux cgroups機制可參考:http://www.infoq.com/cn/artic...

docker服務(wù)安裝 宿主機系統(tǒng)與docker版本選型

從現(xiàn)有的系統(tǒng)來看centos7對虛擬化的支持相對來說更完美,對于docker的版本當然是最新的版本功能更完善;故選擇 Centos7+docker最新版本

kernel升級

現(xiàn)象描述:系統(tǒng)死機
原因描述:centos7.1默認安裝的內(nèi)核為3.10版本,對于運行少量的容器來說不存在任何問題,當運行容器的數(shù)量增多時(比如100臺)就會發(fā)現(xiàn)容器運行一段時間后操作系統(tǒng)會死機,導(dǎo)致整個物理機不可用,經(jīng)研究發(fā)現(xiàn)將系統(tǒng)內(nèi)核升級到4.2即可解決此問題。
解決方案:
查看系統(tǒng)當前內(nèi)核版本

[root@docker6 ~]# uname -a
Linux docker6.stg.1qianbao.com 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

升級kernel至4.2

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
yum install http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install kernel-ml
grub2-set-default 0

重啟操作系統(tǒng)

reboot

再次查看kernel版本

[root@docker6 ~]# uname -a
Linux docker6 4.2.1-1.el7.elrepo.x86_64 #1 SMP Mon Sep 21 20:01:19 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux

如需卸載可使用

yum remove kernel-ml

安裝docker

配置yum源

[root@docker6 ~]# vim /etc/yum.repos.d/docker.repo
[docker-epel]
name=docker-epel
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
gpgcheck=0

亦可下載相關(guān)rpm包至服務(wù)器安裝。

安裝docker

[root@docker6 ~]# yum install docker -y
Loaded plugins: fastestmirror
Repository "moosefs" is missing name in configuration, using id
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
.......
Complete!

啟動docker服務(wù)

[root@docker6 ~]# systemctl start docker.service

查看docker版本

[root@docker6 ~]# docker -v
Docker version 1.7.1, build 786b29d/1.7.1

拉取docker鏡像

本處使用自定倉儲,使用時請根據(jù)實際情況修改

搜索倉儲里面的鏡像

如果倉儲不是https協(xié)議需在docker服務(wù)參數(shù)中使用--insecure-registry=xxoo.com添加至信任列表,并重啟服務(wù)

[root@docker6 ~]# docker search 1qianbao.com/jboss
INDEX          NAME                                        DESCRIPTION   STARS     OFFICIAL   AUTOMATED
1qianbao.com   1qianbao.com/library/centos6.5_jboss                      0                    
1qianbao.com   1qianbao.com/library/centos6.5_jboss_base                 0                    
1qianbao.com   1qianbao.com/library/jboss                                0                    
1qianbao.com   1qianbao.com/library/jboss_logstash                       0 

拉取到本地

[root@docker6 ~]# docker pull 1qianbao.com/jboss
Using default tag: latest
512b1dcc52f6: Download complete 
0757207a8bea: Download complete 
bf839298b71b: Download complete 
15661f85a6fd: Download complete 
d4f8087e2cbc: Download complete 
7aebe5484289: Download complete 
35bd70dfe627: Download complete 
070eee356b7c: Download complete 
6559d408744a: Download complete 
d9406fd1f731: Download complete 
Status: Downloaded newer image for 1qianbao.com/jboss:latest

查看本地鏡像

[root@docker6 ~]# docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
1qianbao.com/jboss   latest              512b1dcc52f6        7 weeks ago         832.8 MB
創(chuàng)建一個容器
[root@docker6 ~]# docker run -id -h test_hostname --name test_conftainer_name 1qianbao.com/jboss /bin/bash
2744cb820ec0b2d8a80d347df3d6631703822841066954ad1dbd3ba779fb09c2
[root@docker6 ~]# docker ps -a
CONTAINER ID        IMAGE                COMMAND             CREATED             STATUS              PORTS               NAMES
2744cb820ec0        1qianbao.com/jboss   "/bin/bash"         59 seconds ago      Up 58 seconds       22/tcp              test_conftainer_name
[root@docker6 ~]# docker exec test_conftainer_name whoami
root
查看容器信息
[root@docker6 ~]# docker inspect test_conftainer_name
[
{
    "Id": "2744cb820ec0b2d8a80d347df3d6631703822841066954ad1dbd3ba779fb09c2",
    "Created": "2017-03-09T08:18:35.542367209Z",
    "Path": "/bin/bash",
    "Args": [],
    "State": {
        "Running": true,
        "Paused": false,
        "Restarting": false,
        "OOMKilled": false,
        "Dead": false,
        "Pid": 41307,
        "ExitCode": 0,
        "Error": "",
        "StartedAt": "2017-03-09T08:18:35.942277675Z",
        "FinishedAt": "0001-01-01T00:00:00Z"
    },
    "Image": "512b1dcc52f663dcc136570f64793fa1a7f4dbb69024e4704a055ef90104ec6f",
    .......
    "HostConfig": {
        "Binds": null,
        "ContainerIDFile": "",
        "LxcConf": [],
        "Memory": 0,
        "MemorySwap": 0,
        "CpuShares": 0,
        "CpuPeriod": 0,
        "CpusetCpus": "",
     .......
]

自定義服務(wù)啟動參數(shù) 修改配置文件
[root@docker4 ~]# cat /etc/sysconfig/docker
# /etc/sysconfig/docker
# Modify these options if you want to change the way the docker daemon runs
OPTIONS="--selinux-enabled=false --storage-driver=devicemapper --storage-opt dm.basesize=100G --insecure-registry=1qianbao.com -b br0 -H unix:///var/run/docker.sock -H tcp://0.0.0.0:9999"
參數(shù)詳解
--storage-driver=devicemapper            #使用devicemapper方式驅(qū)動,驅(qū)動模式詳細介紹可參照[http://blog.csdn.net/qq_26923057/article/details/52351731][3]
--storage-opt dm.basesize=100G           #為每個容器分配100G磁盤空間
--selinux-enabled=false                  #容器內(nèi)禁用selinux
--insecure-registry=1qianbao.com         #指定http協(xié)議訪問的倉儲地址
-H unix:///var/run/docker.sock           #指定docker服務(wù)的socket文件位置,可供其它應(yīng)用通過socket形式訪問
-H tcp://0.0.0.0:9999                    #指定docker服務(wù)remote api端口,可通過docker-py遠程連接訪問
-b br0                                   #容器網(wǎng)絡(luò)使用橋接形式,橋接至本機br0網(wǎng)卡

修改完畢后,重啟docker服務(wù)即可

容器資源限制 內(nèi)存限制
-m, --memory=""                    #限制容器使用的物理內(nèi)存,單位可以為k, m, g等
--memory-swap=""                   #限制容器物理內(nèi)存+swap緩存總和的大小,單位可以為k, m, g等

實例:

[root@docker6 ~]# docker run -id -m 4g --memory-swap=4g -h test_hostname --name test_conftainer_name 1qianbao.com/jboss /bin/bash
2b4dbf2a3d2a146d2958210b783ad7a4fee413c0399757d43464a8a9802bb446
[root@docker6 ~]# docker inspect test_conftainer_name | grep-i "mem"
        "Memory": 4294967296,
        "MemorySwap": 4294967296,
        "CpusetMems": "",
        "MemorySwappiness": -1,
CPU限制
--cpu-shares=0            #設(shè)置CPU利用率權(quán)重,默認為1024
--cpu-period=0            #限制容器的CPU使用周期。一般--cpu-period配合--cpu-quota一起使用。例如cpu-period為100ms,cpu-quota為200ms,表示最多可以使用2個cpu;默認值為100ms
--cpuset-cpus=""          #綁定指定容器使用指定CPU,默認使用所有cpu核心
--cpu-quota=0             #與--cpu-period配合使用

實例:

[root@docker6 ~]# docker run -id --cpu-shares=100 --cpu-period=100000 --cpu-quota=200000 -h test_hostname_cpu --name test_conftainer_cpu 1qianbao.com/jboss /bin/bash
8f1894bf1550f929d10164b3f538af66d7e5922611b58556f5baeea91dfd1c97
[root@docker6 ~]# docker inspect test_conftainer_cpu | grep -i cpu
    "Name": "/test_conftainer_cpu",
        "CpuShares": 100,
        "CpuPeriod": 100000,
        "CpusetCpus": "",
        "CpusetMems": "",
        "CpuQuota": 200000,
        "Hostname": "test_hostname_cpu",
[root@docker6 ~]# docker exec -it test_conftainer_cpu /bin/bash        
[root@test_hostname_cpu /]# cat high_cpu.sh 
#!/bin/bash

while :
do
    let "1+1"
done
[root@test_hostname_cpu /]# bash high_cpu.sh &
[1] 2105
[root@test_hostname_cpu /]# bash high_cpu.sh &
[2] 2106
[root@test_hostname_cpu /]# bash high_cpu.sh &
[3] 2107
[root@test_hostname_cpu /]# ps -ef | grep high_cpu
root       2105     18 70 17:08 ?        00:00:22 bash high_cpu.sh
root       2106     18 67 17:08 ?        00:00:20 bash high_cpu.sh
root       2107     18 68 17:08 ?        00:00:19 bash high_cpu.sh
root       2111     18  0 17:08 ?        00:00:00 grep high_cpu
[root@docker6 ~]# docker stats test_conftainer_cpu
CONTAINER             CPU %               MEM USAGE/LIMIT     MEM %               NET I/O

test_conftainer_cpu 200.04% 15.09 MB/270.4 GB 0.01% 648 B/648 B

服務(wù)調(diào)優(yōu) 內(nèi)核調(diào)優(yōu)

現(xiàn)象描述:網(wǎng)絡(luò)高延時、丟包
原因描述:單臺宿主機運行百臺以上容器時,對宿主機的壓力相應(yīng)增加,其中網(wǎng)絡(luò)方面表現(xiàn)最為明顯;
以ARP為例:容器使用br0的網(wǎng)絡(luò)與外面通信,這樣每臺容器都會將arp信息緩存下來,如果100臺容器分別將網(wǎng)關(guān)、宿主機這兩條信息存入ARP緩存表,那么物理機上的arp緩存表就有200條;而系統(tǒng)默認的arp緩存條目為128條,所以將導(dǎo)致一部分arp信息被覆蓋掉。如果容器間進行頻繁的網(wǎng)絡(luò)通信,就會表現(xiàn)出大量的延時甚至丟包。

[root@docker6 ~]# cat /proc/sys/net/ipv4/neigh/default/gc_thresh1    #系統(tǒng)默認的ARP緩存條目
128
[root@docker6 ~]# cat /proc/sys/net/ipv4/neigh/default/gc_thresh2    #系統(tǒng)ARP條目值的軟限制
512
[root@docker6 ~]# cat /proc/sys/net/ipv4/neigh/default/gc_thresh3    #系統(tǒng)ARP條目值的硬限制
1024

解決方案:
修改系統(tǒng)內(nèi)核參數(shù)

[root@docker6 ~]# vim /etc/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).

net.ipv4.ip_forward=1
net.ipv4.neigh.default.gc_thresh1=25600
net.ipv4.neigh.default.gc_thresh2=51200
net.ipv4.neigh.default.gc_thresh3=102400
net.core.rmem_default = 2097152
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.core.wmem_default = 2097152
net.ipv4.neigh.default.base_reachable_time = 172800
net.ipv4.neigh.default.gc_stale_time = 172800
kernel.msgmax=65536
kernel.msgmnb=65536

重啟或執(zhí)行如下命令使之生效

[root@docker6 ~]# sysctl -p
ulimit調(diào)優(yōu)

現(xiàn)象描述:容器啟動服務(wù)時資源耗盡
原因描述:大宿主機情況下,多個容器并行啟動多進程或多線程服務(wù)時大量消耗文件句柄導(dǎo)致資源耗盡。
解決方案:修改系統(tǒng)對普通用戶的nproc限制

[root@docker6 ~]# cat /etc/security/limits.d/20-nproc.conf 
# Default limit for number of user"s processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

#*          soft    nproc     4096
root       soft    nproc     unlimited

檢測宿主機最大打開的句柄數(shù)可使用:for i in {1..200000};do sleep 2000 & done;

data資源池調(diào)優(yōu)

docker服務(wù)啟動的時候默認會創(chuàng)建一個107.4G的data文件,而后啟動的容器的所有更改內(nèi)容全部存儲至這個data文件中;也就是說當容器內(nèi)產(chǎn)生的相關(guān)data數(shù)據(jù)超過107.4G后容器就再也沒有多余的空間可用,從而導(dǎo)致所有容器的根目錄變?yōu)橹蛔x!

宿主機的docker info信息如下

[root@docker6 ~]# docker info
 Data file: /dev/loop0
 Data Space Used: 2.749 GB
 Data Space Total: 107.4 GB
 Data Space Available: 104.6 GB
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data

解決方案:使用磁盤分區(qū)、lvs邏輯卷、虛擬大文件替換data池文件
本例中使用虛擬大文件替換data池文件,步驟如下:

[root@docker6 ~]# cat init_docker.sh 
#!/bin/bash
echo "stop docker service"
service docker stop
echo "delete the docker data pool"
/bin/rm -rf /var/lib/docker/
echo "create docker data pool"
mkdir -p /var/lib/docker/devicemapper/devicemapper/
dd if=/dev/zero bs=1G count=0 of=/var/lib/docker/devicemapper/devicemapper/data seek=1500
dd if=/dev/zero bs=1G count=0 of=/var/lib/docker/devicemapper/devicemapper/metadata seek=2
#clear veth net
ifconfig | grep veth | awk -F ":" "{print $1}" | while read LINE;do ip link delete $LINE;done
echo "start docker service"
service docker start

[root@docker6 ~]# bash init_docker.sh 

執(zhí)行上述命令后,docker info信息如下

[root@docker6 ~]# docker info | grep Data
 Data file: /dev/loop2
 Data Space Used: 1.821 GB
 Data Space Total: 1.611 TB
 Data Space Available: 1.491 TB
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
制作鏡像文件 基于YUM源制作鏡像

如要制作centos6版本鏡像,宿主機必須也為centos6系統(tǒng);同理制作centos7驚險需在centos7版本宿主機上執(zhí)行

制作鏡像腳本如下:

[root@testmanager ~]# cat create_base_container.sh
#!/bin/bash
yum_config=/etc/yum.conf
if [ -f /etc/dnf/dnf.conf ] && command -v dnf &> /dev/null; then
    yum_config=/etc/dnf/dnf.conf
    alias yum=dnf
fi
target=$(mktemp -d --tmpdir $(basename $0).XXXXXX)
set -x
mkdir -m 755 "$target"/dev
mknod -m 600 "$target"/dev/console c 5 1
mknod -m 600 "$target"/dev/initctl p
mknod -m 666 "$target"/dev/full c 1 7
mknod -m 666 "$target"/dev/null c 1 3
mknod -m 666 "$target"/dev/ptmx c 5 2
mknod -m 666 "$target"/dev/random c 1 8
mknod -m 666 "$target"/dev/tty c 5 0
mknod -m 666 "$target"/dev/tty0 c 4 0
mknod -m 666 "$target"/dev/urandom c 1 9
mknod -m 666 "$target"/dev/zero c 1 5
if [ -d /etc/yum/vars ]; then
    mkdir -p -m 755 "$target"/etc/yum
    cp -a /etc/yum/vars "$target"/etc/yum/
fi 
function clear_repo(){
    rm -f "$target"/etc/yum.repos.d/*
    cp /etc/yum.repos.d/*.repo "$target"/etc/yum.repos.d/
}
yum -c "$yum_config" --installroot="$target" --releasever=/ --setopt=tsflags=nodocs --setopt=group_package_types=mandatory -y groupinstall "Core"
clear_repo
yum -c "$yum_config" --installroot="$target" --releasever=/ --setopt=tsflags=nodocs --setopt=group_package_types=mandatory -y groupinstall "Base"
clear_repo
yum -c "$yum_config" --installroot="$target" --releasever=/ --setopt=tsflags=nodocs --setopt=group_package_types=mandatory -y groupinstall "Chinese Support"
clear_repo
yum -c "$yum_config" --installroot="$target" --releasever=/ --setopt=tsflags=nodocs --setopt=group_package_types=mandatory -y install tar bind-utils wget man sysstat pexpect vim telnet net-tools mysql unzip zip tcpdump lrzsz openssh-clients expect pexpect
yum -c "$yum_config" --installroot="$target" --releasever=/ --setopt=tsflags=nodocs --setopt=group_package_types=mandatory -y reinstall rpm-libs
yum -c "$yum_config" --installroot="$target" --releasever=/ --setopt=tsflags=nodocs --setopt=group_package_types=mandatory -y clean all
cat > "$target"/etc/sysconfig/network < "$target"/etc/sysconfig/network-scripts/ifcfg-eth0 < "$target"/etc/sysconfig/clock
echo "UTC=False" >> "$target"/etc/sysconfig/clock 
#root password is uplooking
password="$6$ZTypyZdt$0.qmfnMd3W5bCFfXjJ2FPPDxxZBVrxd5WYFeEyYfIEwyRXrQtHHztQdNwWjEwCiCPxiTzuTJmns3G7R5q5Y1W."
sed -i "s#root:*#root:${password}#" "$target"/etc/shadow
sed -i "s/#UseDNS yes/UseDNS no/" "$target"/etc/ssh/sshd_config
for file in "$target"/etc/{redhat,system}-release
do
    if [ -r "$file" ]; then
        version="$(sed "s/^[^0-9]*([0-9.]+).*$/1/" "$file")"
        break
    fi
done
version=latest
if [ -z "$version" ]; then
    echo >&2 "warning: cannot autodetect OS version, using "$name" as tag"
    version=$name
fi
tar --numeric-owner -c -C "$target" . | docker import - $name:$version
docker run -i -t --rm $name:$version /bin/bash -c "echo success"
rm -rf "$target"

執(zhí)行結(jié)果如下:

[root@testmanager ~]# bash create_base_container.sh centos6.5_base_image
+ mkdir -m 755 /tmp/create_base_container.sh.vVacHy/dev
+ mknod -m 600 /tmp/create_base_container.sh.vVacHy/dev/console c 5 1
+ mknod -m 600 /tmp/create_base_container.sh.vVacHy/dev/initctl p
+ mknod -m 666 /tmp/create_base_container.sh.vVacHy/dev/full c 1 7
+ mknod -m 666 /tmp/create_base_container.sh.vVacHy/dev/null c 1 3
+ mknod -m 666 /tmp/create_base_container.sh.vVacHy/dev/ptmx c 5 2
........
+ "[" -z latest "]"
+ tar --numeric-owner -c -C /tmp/create_base_container.sh.vVacHy .
+ docker import - centos6.5_base_image:latest
94b212003e6acd1754442a7ce93279a8654c3122d46bbe79fd4ab077ebb1335f
+ docker run -i -t --rm centos6.5_base_image:latest /bin/bash -c "echo success"
success
+ rm -rf /tmp/create_base_container.sh.vVacHy

查看制作的鏡像:

[root@testmanager ~]# docker images
REPOSITORY                                              TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
centos6.5_base_image                                    latest              94b212003e6a        4 minutes ago       438.6 MB
基于Dockerfile制作鏡像

以制作nginx鏡像為例:

編寫nginx啟動腳本

[root@testmanager docker_build_for_nginx]# cat start_nginx
#!/bin/bash

service nginx restart

/bin/bash

編寫Dockerfile文件

[root@testmanager docker_build_for_nginx]# cat Dockerfile 
FROM centos6.5_base_image
MAINTAINER shenpeng.roc@gmail.com
RUN yum install nginx -y
ADD start_nginx.sh /root/start_nginx.sh
EXPOSE 80
CMD ["/bin/bash /root/start_nginx.sh"]

制作鏡像:

[root@testmanager docker_build_for_nginx]# docker build -t "1qianbao.com/nginx_test" .
Sending build context to Docker daemon 3.072 kB
Sending build context to Docker daemon 
Step 0 : FROM centos6.5_base_image
 ---> 94b212003e6a
Step 1 : MAINTAINER shenpeng.roc@gmail.com
 ---> Running in 85d4b56471c5
 ---> c2a862a03b91
Removing intermediate container 85d4b56471c5
Step 2 : RUN yum install nginx -y
 ---> Running in 06864f81b09b
Loaded plugins: fastestmirror
Setting up Install Process
Resolving Dependencies
--> Running transaction check
........
Complete!
 ---> 2f7c48ade298
Removing intermediate container 06864f81b09b
Step 3 : ADD start_nginx.sh /root/start_nginx.sh
 ---> e2934b310453
Removing intermediate container e52c91bc10cb
Step 4 : EXPOSE 80
 ---> Running in 23722048bfd2
 ---> 44b7299c44f9
Removing intermediate container 23722048bfd2
Step 5 : CMD /bin/bash /root/start_nginx.sh
 ---> Running in dd73d04d5e66
 ---> f90eb2c8f500
Removing intermediate container dd73d04d5e66
Successfully built f90eb2c8f500
搭建registry倉儲 安裝registry軟件包
[root@docker6 ~]# yum install docker-registry -y

倉儲默認使用5000端口,配置項為REGISTRY_PORT,配置文件內(nèi)容如下:

[root@docker6 ~]# cat /etc/sysconfig/docker-registry 
# The Docker registry configuration file
# DOCKER_REGISTRY_CONFIG=/etc/docker-registry.yml

# The configuration to use from DOCKER_REGISTRY_CONFIG file
SETTINGS_FLAVOR=local

# Address to bind the registry to
REGISTRY_ADDRESS=0.0.0.0

# Port to bind the registry to
REGISTRY_PORT=5000

# Number of workers to handle the connections
GUNICORN_WORKERS=8
啟動倉儲服務(wù)
[root@docker6 ~]# service docker-registry start
[root@docker6 ~]# netstat -antp | grep 5000
tcp        0      0 0.0.0.0:5000            0.0.0.0:*               LISTEN      45148/python
上傳鏡像至倉儲

docker-registry默認啟動http協(xié)議,故需使用--insecure-registry=127.0.0.1:5000選項添加信任;我的倉儲搭建在本地所以使用127.0.0.1,可跟進實際情況修改,亦可使用域名

[root@docker6 ~]# docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
1qianbao.com/jboss   latest              512b1dcc52f6        7 weeks ago         832.8 MB
[root@docker6 ~]# docker tag 1qianbao.com/jboss 127.0.0.1:5000/test_jboss
[root@docker6 ~]# docker images
REPOSITORY                  TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
1qianbao.com/jboss          latest              512b1dcc52f6        7 weeks ago         832.8 MB
127.0.0.1:5000/test_jboss   latest              512b1dcc52f6        7 weeks ago         832.8 MB
[root@docker6 ~]# docker push 127.0.0.1:5000/test_jboss
The push refers to a repository [127.0.0.1:5000/test_jboss] (len: 1)
Sending image list
Pushing repository 127.0.0.1:5000/test_jboss (1 tags)
0757207a8bea: Image successfully pushed 
bf839298b71b: Image successfully pushed 
15661f85a6fd: Image successfully pushed 
d4f8087e2cbc: Image successfully pushed 
7aebe5484289: Image successfully pushed 
35bd70dfe627: Image successfully pushed 
070eee356b7c: Image successfully pushed 
6559d408744a: Image successfully pushed 
d9406fd1f731: Image successfully pushed 
512b1dcc52f6: Image successfully pushed 
Pushing tag for rev [512b1dcc52f6] on {http://127.0.0.1:5000/v1/repositories/test_jboss/tags/latest}

從倉儲拉取鏡像:
先刪除所有容器及鏡像

[root@docker6 ~]# docker rmi 127.0.0.1:5000/test_jboss
Untagged: 127.0.0.1:5000/test_jboss:latest
[root@docker6 ~]# docker rmi 1qianbao.com/jboss
Untagged: 1qianbao.com/jboss:latest
Deleted: 512b1dcc52f663dcc136570f64793fa1a7f4dbb69024e4704a055ef90104ec6f
Deleted: d9406fd1f7318cd15f0248f8d72dc7945035848867c49350880aaf0b725138a9
Deleted: 6559d408744a0044acb96c6847016f1c2a49d9431b392d6aee10910d33643f81
Deleted: 070eee356b7cdcbdaf894ac47d1587593222e837476b7154a923cc413f8ddc76
Deleted: 35bd70dfe627069114ac98cdd495ddf674f1fc5ddad4318e72f9572475a60c8c
Deleted: 7aebe5484289372c37edf104f26ed76040fa52160b8beb15d3bfdc071383ea13
Deleted: d4f8087e2cbcafff60f4a6bb4f9612c094605cfa2999175b8efb26236d8b7d0a
Deleted: 15661f85a6fd2f7429384634a67a4c317e0474fde7f38e64eef7e28075dbc411
Deleted: bf839298b71b6b9530b992adaba8103e0ca19a0988deb76ea6a1c7e42f980e31
Deleted: 0757207a8bea0e10d2653d1e47af2f5c217e76623cd7ba827ff7747b97b9d3c7
[root@docker6 ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
[root@docker6 ~]# docker rmi 1qianbao.com/jboss
Untagged: 1qianbao.com/jboss:latest
Deleted: 512b1dcc52f663dcc136570f64793fa1a7f4dbb69024e4704a055ef90104ec6f
Deleted: d9406fd1f7318cd15f0248f8d72dc7945035848867c49350880aaf0b725138a9
Deleted: 6559d408744a0044acb96c6847016f1c2a49d9431b392d6aee10910d33643f81
Deleted: 070eee356b7cdcbdaf894ac47d1587593222e837476b7154a923cc413f8ddc76
Deleted: 35bd70dfe627069114ac98cdd495ddf674f1fc5ddad4318e72f9572475a60c8c
Deleted: 7aebe5484289372c37edf104f26ed76040fa52160b8beb15d3bfdc071383ea13
Deleted: d4f8087e2cbcafff60f4a6bb4f9612c094605cfa2999175b8efb26236d8b7d0a
Deleted: 15661f85a6fd2f7429384634a67a4c317e0474fde7f38e64eef7e28075dbc411
Deleted: bf839298b71b6b9530b992adaba8103e0ca19a0988deb76ea6a1c7e42f980e31
Deleted: 0757207a8bea0e10d2653d1e47af2f5c217e76623cd7ba827ff7747b97b9d3c7
[root@docker6 ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
[root@docker6 ~]# docker pull 127.0.0.1:5000/test_jboss
Using default tag: latest
512b1dcc52f6: Pulling dependent layers 
0757207a8bea: Downloading [======================>                            ] 64.03 MB/142.8 MB
0757207a8bea: Pulling metadata 
......

如需使用TLS訪問倉儲可使用nginx在前端做一層代理

docker swarm集群

swarm集群詳細文檔請參照:https://docs.docker.com/engin...

文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請注明本文地址:http://specialneedsforspecialkids.com/yun/26814.html

相關(guān)文章

  • 都9102年了,還不會Docker?10分鐘帶你從入門操作到實戰(zhàn)上手

    摘要:聯(lián)調(diào)測試,無需依賴他人。針對以上問題,有兩種解決方法,一個是自己搭建私有服務(wù),另一個是用云服務(wù)的鏡像管理平臺如阿里云的容器鏡像服務(wù)。利用,先對阿里云的服務(wù)進行登錄。推送后,就能在阿里云的倉庫上看到這個鏡像。 Docker簡述 Docker是一種OS虛擬化技術(shù),是一個開源的應(yīng)用容器引擎。它可以讓開發(fā)者將應(yīng)用打包到一個可移植的容器中,并且該容器可以運行在幾乎所有l(wèi)inux系統(tǒng)中(Windo...

    sf_wangchong 評論0 收藏0
  • Docker實戰(zhàn)指南(一):Docker介紹

    摘要:主機名命名空間,不同的內(nèi)部可以擁有不同的主機名。此外,也是解決跨平臺部署的利器。也許看完上述介紹大家還是云里霧里,沒關(guān)系,既然叫實戰(zhàn)指南,那么必然有實戰(zhàn)部分,我們從最簡單的程序開始。后續(xù)我們將介紹,如果利用運行你自己的程序。 原文地址:Docker實戰(zhàn)指南(一):Docker介紹 Introduction 我第一次注意到Docker大概是在2014年的時候,當時對Docker的第一印象...

    SKYZACK 評論0 收藏0
  • 視頻私有云實戰(zhàn):基于 Docker 構(gòu)建點播私有云平臺

    摘要:本篇文章將會結(jié)合網(wǎng)易云信的實踐經(jīng)驗,以全局概述的方式帶大家認識點播私有化平臺構(gòu)建的整體架構(gòu)面貌。基于構(gòu)建點播私有云平臺在具有以上優(yōu)勢的同時,還具備資源彈性管理監(jiān)控完善部署簡易自動化維護等特性。基于構(gòu)建平臺,能夠自由管理創(chuàng)建云主機。 私有云是為一個客戶單獨使用而構(gòu)建的,因而提供對數(shù)據(jù)、安全性和服務(wù)質(zhì)量的最有效控制。前置條件是客戶擁有基礎(chǔ)設(shè)施,并可以使用基礎(chǔ)設(shè)施在其上部署應(yīng)用程序。其核心屬...

    MadPecker 評論0 收藏0
  • 視頻私有云實戰(zhàn):基于 Docker 構(gòu)建點播私有云平臺

    摘要:本篇文章將會結(jié)合網(wǎng)易云信的實踐經(jīng)驗,以全局概述的方式帶大家認識點播私有化平臺構(gòu)建的整體架構(gòu)面貌。基于構(gòu)建點播私有云平臺在具有以上優(yōu)勢的同時,還具備資源彈性管理監(jiān)控完善部署簡易自動化維護等特性。基于構(gòu)建平臺,能夠自由管理創(chuàng)建云主機。 私有云是為一個客戶單獨使用而構(gòu)建的,因而提供對數(shù)據(jù)、安全性和服務(wù)質(zhì)量的最有效控制。前置條件是客戶擁有基礎(chǔ)設(shè)施,并可以使用基礎(chǔ)設(shè)施在其上部署應(yīng)用程序。其核心屬...

    jkyin 評論0 收藏0

發(fā)表評論

0條評論

最新活動
閱讀需要支付1元查看
<