SlideShare a Scribd company logo
1 of 13
Download to read offline
青云虚机部署私有Docker Registry
Felix.Liang
软件安装包
Docker公司提供的docker-registry有两个版本:python版本和go版本
Python版本在0.9.1版本后已不再更新,实现了docker-registry的V0和V1版本
API,Github地址为https://github.com/docker/docker-registry
Go版本实现了docker-registry的V2版本API,最新版本为2.0.1,只能用于
docker 1.6+,Github地址为https://github.com/docker/distribution
基于docker-registry API构建的第三方UI工具:docker-registry-ui和docker-
registry-frontend
Python版本 + docker-registry-frontend
Docker Registry安装
软件包安装(Ubuntu 14.04)
# sudo apt-get update
# sudo apt-get install -y build-essential python-dev libevent-dev python-pip liblzma-dev
# sudo apt-get install swig
# sudo apt-get install libssl-dev
# sudo pip install docker-registry
修改配置文件
# cd /usr/local/lib/python2.7/dist-packages/config/
# cp config_sample.yml config.yml
修改镜像存储目录,默认配置在/tmp目录下
local: &local
<<: *common
storage: local
storage_path: _env:STORAGE_PATH:/var/lib/docker-registry/registry
修改数据库文件存储目录,默认配置在/tmp目录下
sqlalchemy_index_database: _env:SQLALCHEMY_INDEX_DATABASE:sqlite:////var/lib/docker-registry/docker-
registry.db
Docker Registry安装
封装docker registry为服务
# sudo mkdir -p /var/log/docker-registry
# touch /etc/init/docker-registry.conf
配置Upstart脚本
description "Docker Registry"
start on runlevel [2345]
stop on runlevel [016]
respawn
respawn limit 10 5
script
exec gunicorn --access-logfile /var/log/docker-registry/access.log --error-logfile /var/log/docker-
registry/server.log -k gevent --max-requests 100 --graceful-timeout 3600 -t 3600 -b localhost:5000 -w
8 docker_registry.wsgi:application
end script
启动docker registry
# sudo service docker-registry start
docker-registry start/running, process 25303
Authentication & SSL
安装配置nginx
# sudo apt-get -y install nginx apache2-utils
创建docker用户,设置密码
# sudo htpasswd -c /etc/nginx/docker-registry.htpasswd felix.liang
New password: 123456
Re-type new password:123456
Adding password for user felix.liang
生成自签名SSL证书
# mkdir ~/certs && cd ~/certs
# openssl genrsa -out devdockerCA.key 2048
# openssl req -x509 -new -nodes -key devdockerCA.key -days 10000 -out devdockerCA.crt (直接输入回车即可)
# openssl genrsa -out dev-docker-registry.com.key 2048
# openssl req -new -key dev-docker-registry.com.key -out dev-docker-registry.com.csr (Common Name需设置)
Common Name (e.g. server FQDN or YOUR name) []: registry.22gi5d.gd1.qingcloud.com (建议使用青云内部域名别名)
# openssl x509 -req -in dev-docker-registry.com.csr -CA devdockerCA.crt -CAkey devdockerCA.key -CAcreateserial
-out dev-docker-registry.com.crt -days 10000
# sudo cp dev-docker-registry.com.crt /etc/ssl/certs/docker-registry
# sudo cp dev-docker-registry.com.key /etc/ssl/private/docker-registry
upstream docker-registry {
server localhost:5000;
}
server {
listen 8080;
server_name registry.22gi5d.gd1.qingcloud.com ;
ssl on;
ssl_certificate /etc/ssl/certs/docker-registry;
ssl_certificate_key /etc/ssl/private/docker-registry;
proxy_set_header Host $http_host; # required for Docker client sake
proxy_set_header X-Real-IP $remote_addr; # pass on real client IP
client_max_body_size 0; # disable any limits to avoid HTTP 413 for large image uploads
chunked_transfer_encoding on;
location / {
auth_basic "Restricted";
auth_basic_user_file docker-registry.htpasswd;
proxy_pass http://docker-registry;
}
location /_ping {
auth_basic off;
proxy_pass http://docker-registry;
}
location /v1/_ping {
auth_basic off;
proxy_pass http://docker-registry;
}
}
创建nginx配置文件/etc/nginx/sites-available/
docker-registry
# sudo ln -s /etc/nginx/sites-available/docker-
registry /etc/nginx/sites-enabled/docker-registry
# sudo service nginx restart
需要通过青云console创建防火墙规则打开8080端口,
否则docker无法连接registry
Docker连接Registry
更新docker主机的证书
# sudo mkdir /usr/local/share/ca-certificates/docker-dev-cert
# sudo touch /usr/local/share/ca-certificates/docker-dev-cert/devdockerCA.crt
将registry主机上生成的devdockerCA.crt中证书内容拷贝到docker主机的证书中
# sudo update-ca-certificates
Updating certificates in /etc/ssl/certs... 1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d....done.
# sudo service docker restart
连接registry
# docker login registry.22gi5d.gd1.qingcloud.com:8080
Username: felix.liang
Password: 123456
Email:
WARNING: login credentials saved in /root/.docker/config.json
Login Succeeded
Docker连接Registry
从docker主机上传镜像到registry
从公共registry下载mysql镜像
# sudo docker pull mysql:5.5
# sudo docker tag mysql:5.5 registry.22gi5d.gd1.qingcloud.com:8080/mysql:5.5
# sudo docker push registry.22gi5d.gd1.qingcloud.com:8080/mysql:5.5
从registry下载镜像到docker主机
清空本地所有镜像,然后从registry查询和下载镜像
# sudo docker search registry.22gi5d.gd1.qingcloud.com:8080/mysql
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
library/mysql
# sudo docker pull registry.22gi5d.gd1.qingcloud.com:8080/mysql:5.5
…
Status: Downloaded newer image for registry.22gi5d.gd1.qingcloud.com:8080/mysql:5.5
运行Registry前端工具
直接以容器方式启动docker-registry-frontend
# sudo docker run -d -e ENV_DOCKER_REGISTRY_HOST=registry.22gi5d.gd1.qingcloud.com -e
ENV_DOCKER_REGISTRY_PORT=8080 -e ENV_DOCKER_REGISTRY_USE_SSL=1 -p 8090:80 konradkleine/docker-
registry-frontend
查看容器是否启动成功
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
d953be033dfd konradkleine/docker-registry-frontend "/bin/sh -c $START_S 14 seconds ago Up 13
seconds 443/tcp, 0.0.0.0:8090->80/tcp condescending_leakey
运行Registry前端工具
运行Registry前端工具
运行Registry前端工具
运行Registry前端工具

More Related Content

What's hot

Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with Docker
Patrick Mizer
 

What's hot (20)

Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To Running
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with Docker
 
LinuxKit Deep Dive
LinuxKit Deep DiveLinuxKit Deep Dive
LinuxKit Deep Dive
 
Intro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and WindowsIntro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and Windows
 
Docker security introduction-task-2016
Docker security introduction-task-2016Docker security introduction-task-2016
Docker security introduction-task-2016
 
CoreOS Overview and Current Status
CoreOS Overview and Current StatusCoreOS Overview and Current Status
CoreOS Overview and Current Status
 
KubeCon EU 2016: Creating an Advanced Load Balancing Solution for Kubernetes ...
KubeCon EU 2016: Creating an Advanced Load Balancing Solution for Kubernetes ...KubeCon EU 2016: Creating an Advanced Load Balancing Solution for Kubernetes ...
KubeCon EU 2016: Creating an Advanced Load Balancing Solution for Kubernetes ...
 
Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
 
KubeCon EU 2016: Kubernetes and the Potential for Higher Level Interfaces
KubeCon EU 2016: Kubernetes and the Potential for Higher Level InterfacesKubeCon EU 2016: Kubernetes and the Potential for Higher Level Interfaces
KubeCon EU 2016: Kubernetes and the Potential for Higher Level Interfaces
 
Docker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting TechniquesDocker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting Techniques
 
DockerCon Keynote Ben Golub
DockerCon Keynote Ben GolubDockerCon Keynote Ben Golub
DockerCon Keynote Ben Golub
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
 
PHP development with Docker
PHP development with DockerPHP development with Docker
PHP development with Docker
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016
 
[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
 
The state of the swarm
The state of the swarmThe state of the swarm
The state of the swarm
 
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
 
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment
 

Viewers also liked

Viewers also liked (12)

微软Bot framework简介
微软Bot framework简介微软Bot framework简介
微软Bot framework简介
 
开源Pass平台flynn功能简介
开源Pass平台flynn功能简介开源Pass平台flynn功能简介
开源Pass平台flynn功能简介
 
青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes 青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes
 
thesis_palogiannidi
thesis_palogiannidithesis_palogiannidi
thesis_palogiannidi
 
An Intelligent Assistant for High-Level Task Understanding
An Intelligent Assistant for High-Level Task UnderstandingAn Intelligent Assistant for High-Level Task Understanding
An Intelligent Assistant for High-Level Task Understanding
 
End-to-End Memory Networks with Knowledge Carryover for Multi-Turn Spoken Lan...
End-to-End Memory Networks with Knowledge Carryover for Multi-Turn Spoken Lan...End-to-End Memory Networks with Knowledge Carryover for Multi-Turn Spoken Lan...
End-to-End Memory Networks with Knowledge Carryover for Multi-Turn Spoken Lan...
 
Why Chatbot? 為何開發聊天機器人?
Why Chatbot?  為何開發聊天機器人?Why Chatbot?  為何開發聊天機器人?
Why Chatbot? 為何開發聊天機器人?
 
Statistical Learning from Dialogues for Intelligent Assistants
Statistical Learning from Dialogues for Intelligent AssistantsStatistical Learning from Dialogues for Intelligent Assistants
Statistical Learning from Dialogues for Intelligent Assistants
 
Cascon 2016 Keynote: Disrupting Developer Productivity One Bot at a Time
Cascon 2016 Keynote: Disrupting Developer Productivity One Bot at a TimeCascon 2016 Keynote: Disrupting Developer Productivity One Bot at a Time
Cascon 2016 Keynote: Disrupting Developer Productivity One Bot at a Time
 
Harm van Seijen, Research Scientist, Maluuba at MLconf SF 2016
Harm van Seijen, Research Scientist, Maluuba at MLconf SF 2016Harm van Seijen, Research Scientist, Maluuba at MLconf SF 2016
Harm van Seijen, Research Scientist, Maluuba at MLconf SF 2016
 
如何透過聊天機器人(Chatbot)來翻轉企業與客戶溝通方式&【凡事都有個 Bot:虛擬篇】聊天機器人的前世今生 | 20160918 科技時事報導
如何透過聊天機器人(Chatbot)來翻轉企業與客戶溝通方式&【凡事都有個 Bot:虛擬篇】聊天機器人的前世今生 | 20160918 科技時事報導  如何透過聊天機器人(Chatbot)來翻轉企業與客戶溝通方式&【凡事都有個 Bot:虛擬篇】聊天機器人的前世今生 | 20160918 科技時事報導
如何透過聊天機器人(Chatbot)來翻轉企業與客戶溝通方式&【凡事都有個 Bot:虛擬篇】聊天機器人的前世今生 | 20160918 科技時事報導
 
End-to-End Joint Learning of Natural Language Understanding and Dialogue Manager
End-to-End Joint Learning of Natural Language Understanding and Dialogue ManagerEnd-to-End Joint Learning of Natural Language Understanding and Dialogue Manager
End-to-End Joint Learning of Natural Language Understanding and Dialogue Manager
 

Similar to 青云虚拟机部署私有Docker Registry

Similar to 青云虚拟机部署私有Docker Registry (20)

Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016
 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 aug
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Docker engine - Indroduc
Docker engine - IndroducDocker engine - Indroduc
Docker engine - Indroduc
 
Docker
DockerDocker
Docker
 
Very Early Review - Rocket(CoreOS)
Very Early Review - Rocket(CoreOS)Very Early Review - Rocket(CoreOS)
Very Early Review - Rocket(CoreOS)
 
Apache jclouds and Docker
Apache jclouds and DockerApache jclouds and Docker
Apache jclouds and Docker
 
Docker &amp; rancher
Docker &amp; rancherDocker &amp; rancher
Docker &amp; rancher
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Docker - introduction
Docker - introductionDocker - introduction
Docker - introduction
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
Docker & Kubernetes
Docker & KubernetesDocker & Kubernetes
Docker & Kubernetes
 
Docking with Docker
Docking with DockerDocking with Docker
Docking with Docker
 
Delivering Docker & K3s worloads to IoT Edge devices
Delivering Docker & K3s worloads to IoT Edge devicesDelivering Docker & K3s worloads to IoT Edge devices
Delivering Docker & K3s worloads to IoT Edge devices
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作
 
How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environment
 
廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班
 
Docker security
Docker securityDocker security
Docker security
 

More from Zhichao Liang

A novel method to extend flash memory lifetime in flash based dbms
A novel method to extend flash memory lifetime in flash based dbmsA novel method to extend flash memory lifetime in flash based dbms
A novel method to extend flash memory lifetime in flash based dbms
Zhichao Liang
 

More from Zhichao Liang (11)

Introduction of own cloud
Introduction of own cloudIntroduction of own cloud
Introduction of own cloud
 
Power drill列存储底层设计
Power drill列存储底层设计Power drill列存储底层设计
Power drill列存储底层设计
 
C store底层存储设计
C store底层存储设计C store底层存储设计
C store底层存储设计
 
Storage Class Memory: Technology Overview & System Impacts
Storage Class Memory: Technology Overview & System ImpactsStorage Class Memory: Technology Overview & System Impacts
Storage Class Memory: Technology Overview & System Impacts
 
A simple introduction to redis
A simple introduction to redisA simple introduction to redis
A simple introduction to redis
 
Memcached简介
Memcached简介Memcached简介
Memcached简介
 
Some key value stores using log-structure
Some key value stores using log-structureSome key value stores using log-structure
Some key value stores using log-structure
 
A novel method to extend flash memory lifetime in flash based dbms
A novel method to extend flash memory lifetime in flash based dbmsA novel method to extend flash memory lifetime in flash based dbms
A novel method to extend flash memory lifetime in flash based dbms
 
Sub join a query optimization algorithm for flash-based database
Sub join a query optimization algorithm for flash-based databaseSub join a query optimization algorithm for flash-based database
Sub join a query optimization algorithm for flash-based database
 
Hush…tell you something novel about flash memory
Hush…tell you something novel about flash memoryHush…tell you something novel about flash memory
Hush…tell you something novel about flash memory
 
Survey of distributed storage system
Survey of distributed storage systemSurvey of distributed storage system
Survey of distributed storage system
 

Recently uploaded

Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
nilamkumrai
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 

Recently uploaded (20)

All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
 
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
 

青云虚拟机部署私有Docker Registry

  • 3. Docker Registry安装 软件包安装(Ubuntu 14.04) # sudo apt-get update # sudo apt-get install -y build-essential python-dev libevent-dev python-pip liblzma-dev # sudo apt-get install swig # sudo apt-get install libssl-dev # sudo pip install docker-registry 修改配置文件 # cd /usr/local/lib/python2.7/dist-packages/config/ # cp config_sample.yml config.yml 修改镜像存储目录,默认配置在/tmp目录下 local: &local <<: *common storage: local storage_path: _env:STORAGE_PATH:/var/lib/docker-registry/registry 修改数据库文件存储目录,默认配置在/tmp目录下 sqlalchemy_index_database: _env:SQLALCHEMY_INDEX_DATABASE:sqlite:////var/lib/docker-registry/docker- registry.db
  • 4. Docker Registry安装 封装docker registry为服务 # sudo mkdir -p /var/log/docker-registry # touch /etc/init/docker-registry.conf 配置Upstart脚本 description "Docker Registry" start on runlevel [2345] stop on runlevel [016] respawn respawn limit 10 5 script exec gunicorn --access-logfile /var/log/docker-registry/access.log --error-logfile /var/log/docker- registry/server.log -k gevent --max-requests 100 --graceful-timeout 3600 -t 3600 -b localhost:5000 -w 8 docker_registry.wsgi:application end script 启动docker registry # sudo service docker-registry start docker-registry start/running, process 25303
  • 5. Authentication & SSL 安装配置nginx # sudo apt-get -y install nginx apache2-utils 创建docker用户,设置密码 # sudo htpasswd -c /etc/nginx/docker-registry.htpasswd felix.liang New password: 123456 Re-type new password:123456 Adding password for user felix.liang 生成自签名SSL证书 # mkdir ~/certs && cd ~/certs # openssl genrsa -out devdockerCA.key 2048 # openssl req -x509 -new -nodes -key devdockerCA.key -days 10000 -out devdockerCA.crt (直接输入回车即可) # openssl genrsa -out dev-docker-registry.com.key 2048 # openssl req -new -key dev-docker-registry.com.key -out dev-docker-registry.com.csr (Common Name需设置) Common Name (e.g. server FQDN or YOUR name) []: registry.22gi5d.gd1.qingcloud.com (建议使用青云内部域名别名) # openssl x509 -req -in dev-docker-registry.com.csr -CA devdockerCA.crt -CAkey devdockerCA.key -CAcreateserial -out dev-docker-registry.com.crt -days 10000 # sudo cp dev-docker-registry.com.crt /etc/ssl/certs/docker-registry # sudo cp dev-docker-registry.com.key /etc/ssl/private/docker-registry
  • 6. upstream docker-registry { server localhost:5000; } server { listen 8080; server_name registry.22gi5d.gd1.qingcloud.com ; ssl on; ssl_certificate /etc/ssl/certs/docker-registry; ssl_certificate_key /etc/ssl/private/docker-registry; proxy_set_header Host $http_host; # required for Docker client sake proxy_set_header X-Real-IP $remote_addr; # pass on real client IP client_max_body_size 0; # disable any limits to avoid HTTP 413 for large image uploads chunked_transfer_encoding on; location / { auth_basic "Restricted"; auth_basic_user_file docker-registry.htpasswd; proxy_pass http://docker-registry; } location /_ping { auth_basic off; proxy_pass http://docker-registry; } location /v1/_ping { auth_basic off; proxy_pass http://docker-registry; } } 创建nginx配置文件/etc/nginx/sites-available/ docker-registry # sudo ln -s /etc/nginx/sites-available/docker- registry /etc/nginx/sites-enabled/docker-registry # sudo service nginx restart 需要通过青云console创建防火墙规则打开8080端口, 否则docker无法连接registry
  • 7. Docker连接Registry 更新docker主机的证书 # sudo mkdir /usr/local/share/ca-certificates/docker-dev-cert # sudo touch /usr/local/share/ca-certificates/docker-dev-cert/devdockerCA.crt 将registry主机上生成的devdockerCA.crt中证书内容拷贝到docker主机的证书中 # sudo update-ca-certificates Updating certificates in /etc/ssl/certs... 1 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d....done. # sudo service docker restart 连接registry # docker login registry.22gi5d.gd1.qingcloud.com:8080 Username: felix.liang Password: 123456 Email: WARNING: login credentials saved in /root/.docker/config.json Login Succeeded
  • 8. Docker连接Registry 从docker主机上传镜像到registry 从公共registry下载mysql镜像 # sudo docker pull mysql:5.5 # sudo docker tag mysql:5.5 registry.22gi5d.gd1.qingcloud.com:8080/mysql:5.5 # sudo docker push registry.22gi5d.gd1.qingcloud.com:8080/mysql:5.5 从registry下载镜像到docker主机 清空本地所有镜像,然后从registry查询和下载镜像 # sudo docker search registry.22gi5d.gd1.qingcloud.com:8080/mysql NAME DESCRIPTION STARS OFFICIAL AUTOMATED library/mysql # sudo docker pull registry.22gi5d.gd1.qingcloud.com:8080/mysql:5.5 … Status: Downloaded newer image for registry.22gi5d.gd1.qingcloud.com:8080/mysql:5.5
  • 9. 运行Registry前端工具 直接以容器方式启动docker-registry-frontend # sudo docker run -d -e ENV_DOCKER_REGISTRY_HOST=registry.22gi5d.gd1.qingcloud.com -e ENV_DOCKER_REGISTRY_PORT=8080 -e ENV_DOCKER_REGISTRY_USE_SSL=1 -p 8090:80 konradkleine/docker- registry-frontend 查看容器是否启动成功 # docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d953be033dfd konradkleine/docker-registry-frontend "/bin/sh -c $START_S 14 seconds ago Up 13 seconds 443/tcp, 0.0.0.0:8090->80/tcp condescending_leakey