Enterprise-Class Docker-harbor

Source: Internet
Author: User
Tags openssl x509

"Environment Preparation"

# Yum install-y yum-utils device-mapper-persistent-data lvm2

Download the docker-ce version of the Yum source

# Yum-config-manager--add-repo Https://download.docker.com/linux/centos/docker-ce.repo

Yum Install Docker-ce Open source version

#yum install-y Docker-ce

#systemctl start Docker #启动docker-ce version

" Install Docker-compos"

Docker-compos is a docker application that defines and runs multiple containers, uses a service that defines a YAML file to configure the app, and can create all the services that are configured with a simple command

Docker-compos Basic Three processes:

    • Define your app environment in Dockerfile and make it copy anywhere
    • In Docker-conpos.yml, define the services that make up the application to facilitate running together in an isolated environment
    • Running Docker Up-d.compose will start and run the entire application

# Curl-l https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$ (uname-s)-$ (uname-m)-O/ Usr/local/bin/docker-compos

Ps:curl: (+) Peer reports incompatible or unsupported protocol version. #如果上述命令执行出现这种报错, the Yum update NSS CURL-Y update is available because NCC and URL versions are too low

[Email protected] ~]# chmod +x/usr/local/bin/docker-compose
[Email protected] ~]# ll-d/usr/local/bin/docker-compose
-rwxr-xr-x 1 root root 10861704 October 17:49/usr/local/bin/docker-compose

[[Email protected] ~] # docker-compose--version

"Install Docker-harbor"

#wget https://storage.googleapis.com/harbor-releases/release-1.4.0/harbor-offline-installer-v1.4.0.tgz

[[Email protected] ~] # tar zxvf harbor-offline-installer-v1.4.0.tgz-c/usr/local/

[Email protected] ~]# cd/usr/local/harbor/

[Email protected] harbor]# vim harbor.cfg

[Email protected] cert]# OpenSSL req-newkey rsa:4096-nodes-sha256-keyout ca.key-x509-days 365-out ca.crt-subj "/c=cn/l=wuhan/o=lisea/cn=harbor-registry"

[Email protected] cert]# OpenSSL req-newkey rsa:4096-nodes-sha256-keyout harbor.lisea.cn.key-out server.csr-sub J "/c=cn/l=wuhan/o=lisea/cn=harbor.bxy.com"

[Email protected] cert]# OpenSSL x509-req-days 365-in server.csr-ca ca.crt-cakey ca.key-cacreateserial-out har Bor.bxy.com

[[email protected] harbor] # cd/usr/local/harbor/

[[email protected] harbor] #./prepare or./install

[[email protected] harbor] # docker-compose up-d #启动harbor
Harbor-log is up-to-date
HARBOR-DB is up-to-date
Harbor-adminserver is up-to-date
Registry is up-to-date
Harbor-ui is up-to-date
Harbor-jobservice is up-to-date
Nginx is up-to-date

Authentication

The default user name and password are: admin/harbor12345

https://192.168.37.138

or: https://harbor.bxy.com PS: Domain name has been configured in the Harbor.cfg configuration file, only need to be on the local computer host domain name resolution can be

"Verifying Uploads and downloads"

First modify the Docker configuration file

# Vim/usr/lib/systemd/system/docker.service

Execstart=/usr/bin/dockerd--insecure-registry=harbor.bxy.com

# Systemctl Daemon-reload

# Systemctl Restart Docker

"Harbor Access Image"

[[email protected] harbor] # docker login-uadmin-pharbor12345 harborbxy.com

Push upload image to harbor

Format: Tag docker tag "Local Mirror Source" "Domain/project name/Latest image name: Label"

Upload format: Docker push "Harbor Domain/project name/crime mirror name: Tag"

[Email protected] harbor]# docker tag centos7:test01 jfedu.bxy.com/centos7/centos7:v1.10

[Email protected] harbor]# Docker push jfedu.bxy.com/centos7/centos7:v1.10

[[email protected] harbor] # Docker Pull jfedu.bxy.com/centos7/centos7:v1.10

Enterprise-Class Docker-harbor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.