Relevant information:
Harbor official website: https://goharbor.io/
Harbor Github Address: https://github.com/goharbor/harbor
⒈ installation Docker (requirement)
1. See https://www.cnblogs.com/fanqisoft/p/10439620.html mounted Docker
2. Configure trusted in the Docker
// Edit docker server provided Vim / etc / docker / daemon.json // The following was added to the contents of the configuration file " in the insecure-Registries " : [ " https://hub.coreqi.cn " ] // reload configuration file systemctl daemon- reload // restart Docker systemctl restart Docker // View settings have taken effect Docker info
⒉ installation
1. Download the installation package offline
wget https://storage.googleapis.com/harbor-releases/release-1.9.0/harbor-offline-installer-v1.9.0-rc1.tgz
2. Extract the installation package offline
tar -zxvf harbor-offline-installer-v1.9.0-rc1.tgz
3. Generate a private key using the official tutorial address: https://github.com/goharbor/harbor/blob/master/docs/configure_https.md
# Create a directory to save the private key certificates mkdir -p / the Data / CERT cd / the Data / CERT # generate private - pay attention to enter the same password twice private OpenSSL genrsa -des3--out server.key 2048 # generate a certificate - enter the private key password - enter the country code - enter the province abbreviation - enter a city abbreviation - enter the organization abbreviations - abbreviations input mechanism - enter a domain name - enter the administrator mailbox - change the password (can be ignored, directly back car can) OpenSSL REQ -new -key server.key - OUT server.csr # private key backup cp server.key server.key.org # converted to a certificate [because Docker inside the boot using Nginx front end, so the boot If the private key and certificate is password, then there will be guided unsuccessful problem, so we need to remove the password and private key certificates, this step is to perform the operation] OpenSSL rsa - in server.key.org - OUT Server .key # re-signed certificate generation openssl x509-days -req 365 - in server.csr -signkey server.key - OUT server.crt # reassign the certificate authority chmod A + the X-*
4. Edit Harbor profile
Back extract the directory # cd - cd Harbor / vim harbor.yml
Here are some we can not change the password configuration, but keep in mind.
Rebuild the configuration file for the Harbor
./prepare
5. Installation docker-compose
# Download the latest version docker- Compose file sudo curl -L HTTPS: // github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` -o / usr / local / bin / Docker-Compose # executable permissions to add the sudo the chmod + X / usr / local / bin / docker- Compose # test results mounted Docker -compose --version
6. Start the installation
./install.sh
Successful installation.
7. Start Configuration
1. Add the host mapping
echo "192.168.227.129 hub.coreqi.cn" >> /etc/hosts
cat /ect/hosts
2. Access https://hub.coreqi.cn test
8. Log private warehouse, test whether you can successfully connect
// Enter the admin account password docker login https://hub.coreqi.cn
** After user login information is saved in $ HOME / .docker / config.json, if you need to switch accounts to empty the contents of the file can be.
9. Test
1. Make image
// pulling hello-world image of example Docker pull hello-world // create private image docker tag hello-world hub.coreqi.cn/library/hello-world
2. pushed to the private warehouse
// pushed to the private server docker push hub.coreqi.cn/library/hello-world