docker使用阿里云镜像仓库

本文介绍了阿里云docker仓库的使用方法。首先给出仓库链接,注册账号后可在管理中心找到加速器及加速地址和设置步骤。还展示了配置docker镜像加速器的代码,包括docker.service文件的详细配置内容。

一、阿里云docker仓库

1:阿里云docker仓库 https://dev.aliyun.com/search.html

2:进去注册帐号后,点击自己的管理中心。

3:在管理中心点击加速器,右边面板会有你的加速地址,右边面板下面有详细设置步骤。 

4、配置docker镜像加速器:

[root@docker ~] # cat /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=http: //docs .docker.com
After=network.target rhel-push-plugin.socket registries.service
Wants=docker-storage-setup.service
Requires=docker-cleanup.timer
 
[Service]
Type=notify
NotifyAccess=all
EnvironmentFile=- /run/containers/registries .conf
EnvironmentFile=- /etc/sysconfig/docker
EnvironmentFile=- /etc/sysconfig/docker-storage
EnvironmentFile=- /etc/sysconfig/docker-network
Environment=GOTRACEBACK=crash
Environment=DOCKER_HTTP_HOST_COMPAT=1
Environment=PATH= /usr/libexec/docker : /usr/bin : /usr/sbin
ExecStart= /usr/bin/dockerd-current  --registry-mirror=https: //alzgoonw .mirror.aliyuncs.com \
           --add-runtime docker-runc= /usr/libexec/docker/docker-runc-current  \
           --default-runtime=docker-runc \
           -- exec -opt native.cgroupdriver=systemd \
           --userland-proxy-path= /usr/libexec/docker/docker-proxy-current  \
           --init-path= /usr/libexec/docker/docker-init-current  \
           --seccomp-profile= /etc/docker/seccomp .json \
           $OPTIONS \
           $DOCKER_STORAGE_OPTIONS \
           $DOCKER_NETWORK_OPTIONS \
           $ADD_REGISTRY \
           $BLOCK_REGISTRY \
           $INSECURE_REGISTRY \
       $REGISTRIES
ExecReload= /bin/kill  -s HUP $MAINPID
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
TimeoutStartSec=0
Restart=on-abnormal
KillMode=process
 
[Install]
WantedBy=multi-user.target

  

[root@docker ~]# cat /usr/lib/systemd/system/docker.service[Unit]Description=Docker Application Container EngineDocumentation=http://docs.docker.comAfter=network.target rhel-push-plugin.socket registries.serviceWants=docker-storage-setup.serviceRequires=docker-cleanup.timer
[Service]Type=notifyNotifyAccess=allEnvironmentFile=-/run/containers/registries.confEnvironmentFile=-/etc/sysconfig/dockerEnvironmentFile=-/etc/sysconfig/docker-storageEnvironmentFile=-/etc/sysconfig/docker-networkEnvironment=GOTRACEBACK=crashEnvironment=DOCKER_HTTP_HOST_COMPAT=1Environment=PATH=/usr/libexec/docker:/usr/bin:/usr/sbinExecStart=/usr/bin/dockerd-current --registry-mirror=https://alzgoonw.mirror.aliyuncs.com \          --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \          --default-runtime=docker-runc \          --exec-opt native.cgroupdriver=systemd \          --userland-proxy-path=/usr/libexec/docker/docker-proxy-current \          --init-path=/usr/libexec/docker/docker-init-current \          --seccomp-profile=/etc/docker/seccomp.json \          $OPTIONS \          $DOCKER_STORAGE_OPTIONS \          $DOCKER_NETWORK_OPTIONS \          $ADD_REGISTRY \          $BLOCK_REGISTRY \          $INSECURE_REGISTRY \  $REGISTRIESExecReload=/bin/kill -s HUP $MAINPIDLimitNOFILE=1048576LimitNPROC=1048576LimitCORE=infinityTimeoutStartSec=0Restart=on-abnormalKillMode=process
[Install]WantedBy=multi-user.target

转载于:https://www.cnblogs.com/skgoo/p/10811673.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值