Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ CentOS 7 Docker build private warehouse registry     - Java, hashcode, equals and == (Programming)

- Jump table (skiplist) of code (Programming)

- Linux regex sed detailing (Linux)

- Linux maximum number of threads and limit the number of queries the current thread (Linux)

- Linux installation is larger than 2TB (UEFI interface) hard disk solution (Linux)

- CentOS iptables firewall configuration (Linux)

- Making Linux root file system problems on-link library (Programming)

- Linux operating system boot manager -GRUB (Linux)

- Use Python to perform system commands common usage (Programming)

- Circular list of Java programming (Programming)

- Setting Derby as Linux / Windows running as a service from the start (Server)

- grep command output highlighted word (Linux)

- CentOS 6.5 system installation Oracle11.2.0.4 basic steps (Database)

- Ubuntu 15.04 / 14.04 install Ubuntu After Install 2.6 (Linux)

- Linux kernel compilation, the configuration of the motor drive (Programming)

- Use ARChon runtime environment to run Android apps on Ubuntu (Linux)

- Deploy the project to the server from GitHub (Server)

- How to disable IPv6 on Ubuntu, Linux Mint, Debian (Linux)

- Android judgment toward camera pictures (Programming)

- 25 Git Usage Tips (Linux)

 
         
  CentOS 7 Docker build private warehouse registry
     
  Add Date : 2017-01-08      
         
         
         
  Environmental Planning:

docker private warehouse address: 192.168.0.167
docker Client Address: 192.168.0.167
Turn off the firewall and selinux

 systemctl stop firewalld.service
  systemctl disable firewalld.service
  
  # Vi / etc / sysconfig / selinux
        SELINUX = disabled
  # Setenforce 0

Server

1. Install and start docker

yum -y install docker
  service docker start
  chkconfig docker on

2. Pull the local private warehouse registry

 [Root @ localhost ~] # docker pull registry
Trying to pull repository docker.io/registry ...
24dd746e9b9f: Download complete
706766fe1019: Download complete
a62a42e77c9c: Download complete
2c014f14d3d9: Download complete
b7cf8f0d9e82: Download complete
d0b170ebeeab: Download complete
171efc310edf: Download complete
522ed614b07a: Download complete
605ed9113b86: Download complete
22b93b23ebb9: Download complete
2ac557a88fda: Download complete
1f3b4c532640: Download complete
27ebaac643a7: Download complete
ce630195cb45: Download complete
Status: Downloaded newer image for docker.io/registry:latest

3. Check the registry mirror

[Root @ localhost ~] # docker images
docker.io/busybox latest 0064fda8c45d 5 days ago 1.113 MB
docker.io/registry latest 105c6c9299d9 5 days ago 423.3 MB
docker.io/CentOS latest ce20c473cd8a 6 days ago 172.3 MB

4. Mirror operation based on private container warehouse

By default, the warehouse will be stored in the container / tmp / directory under the registry, so if the container is removed, the image is stored in the container will be lost, so under normal circumstances we will specify a local directory is mounted to the container under / tmp / registry, there are two directories!

Registry default storage path is / tmp / registry, only a temporary directory, and will disappear after a period of time

So using the -v parameter to specify the path to lasting local,

[Root @ localhost ~] # docker run -d -p 5000: 5000 -v / opt / data / registry: / tmp / registry docker.io/registry
bb2c0d442df94e281479332c2608ef144f378e71743c5410e36b80c465771a95
root @ localhost ~] # docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bb2c0d442df9 docker.io/registry:latest "docker-registry" 10 seconds ago Up 7 seconds

5. Access private warehouse

[Root @ localhost ~] # curl 127.0.0.1:5000/v1/search
{ "Num_results": 0, "query": "", "results": []} # private warehouse is empty, did not submit a new image to the repository

6. From the Docker HUB pull a mirror test

[Root @ localhost ~] #docker pull busybox
[Root @ localhost ~] #docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
docker.io/busybox latest 0064fda8c45d 5 days ago 1.113 MB
docker.io/registry latest 105c6c9299d9 5 days ago 423.3 MB
docker.io/centos latest ce20c473cd8a 6 days ago 172.3 MB

7. Create a mirror image to make a link-based label

[Root @ localhost ~] # docker tag docker.io/busybox 192.168.0.167:5000/busybox
[Root @ localhost ~] # docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
192.168.0.167:5000/busybox latest 0064fda8c45d 5 days ago 1.113 MB
docker.io/busybox latest 0064fda8c45d 5 days ago 1.113 MB
docker.io/registry latest 105c6c9299d9 5 days ago 423.3 MB
docker.io/centos latest ce20c473cd8a 6 days ago 172.3 MB

8. Modify docker configuration file, specify the private warehouse url

[Root @ localhost ~] # vim / etc / sysconfig / docker
Modify this line
OPTIONS = '- insecure-registry 192.168.0.167:5000'
[Root @ localhost ~] # service docker restart

9. Upload mirrored to a local private warehouse

docker push 192.168.0.167:5000/busybox

10. Check whether there is a corresponding private warehouse mirror

[Root @ localhost ~] # curl 192.168.0.167:5000/v1/search
{ "Num_results": 1, "query": "", "results": [{ "description": "", "name": "library / busybox"}]}

11. See mirrored storage directories and files

[Root @ localhost ~] # tree / opt / data / registry / repositories /
/ Opt / data / registry / repositories /
library
 ssh
index_images
 json
tag_latest
 taglatest_json
  
2 directories, 4 files

Client

1. Install and start docker

  yum -y install docker
  service docker start
  chkconfig docker on

2. Modify the docker configuration file, specify the private warehouse url

[Root @ localhost ~] # vim / etc / sysconfig / docker
Modify this line
OPTIONS = '- insecure-registry 192.168.0.167:5000'
[Root @ localhost ~] # service docker restart

3. Test, just download the uploaded image

[Root @ localhost ~] # docker pull 192.168.0.167:5000/busybox
 [Root @ localhost ~] # docker images
 REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
192.168.0.167:5000/busybox latest 0064fda8c45d 5 days ago 1.113 MB
docker.io/registry latest 105c6c9299d9 5 days ago 423.3 MB
docker.io/centos latest ce20c473cd8a 6 days ago 172.3 MB
docker.io/atcol/docker-registry-ui latest d838355ad903 6 months ago 890.5 MB
     
         
         
         
  More:      
 
- GAMIT learning materials finishing (Linux)
- The method of MySQL two kinds of incomplete recovery (Database)
- Use Bosh deploy CloudFoundry problems encountered on OpenStack (Server)
- Virt Related Command Summary (Linux)
- Compiling source code Nginx module installation subs_filter (Server)
- Oracle 11g principle study Dataguard (Database)
- RabbitMQ tutorial examples: the Hello RabbitMQ World Java realization (Linux)
- To restore the last time applications running when Ubuntu user log in again (Linux)
- Linux system started to learn: the Linux syslog (Linux)
- Linux system on a virtual machine to access the Internet (Linux)
- 10 useful Linux command Interview Questions and Answers (Linux)
- pkg-config to use (Linux)
- Linux beginners should know 12 commands (Linux)
- Hadoop virtualization performance comparison and tuning experience (Server)
- Understanding Linux firewall Iptables (Linux)
- PL / SQL in forall simple test (Database)
- High-performance Linux system firewall detailed analysis of double-effect (Linux)
- To install Redis under Linux (Database)
- Ubuntu 15.10 installation and deployment Swift development environment (Linux)
- Go build the locale under Windows (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.