In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Original articles, welcome to reprint. Reprint please indicate: reproduced from IT Story Association, thank you!
Original link address: "Advanced articles" docker Image Warehouse (20)
The second step of the three steps is to check the image warehouse and learn from docker warehouses. There are two kinds of warehouses. Other people's warehouses are also called public warehouses, and their own warehouses are also called private warehouses. The biggest difference between the public warehouse and the private warehouse is the network speed, the public warehouse from the public network, the private warehouse is from the local area network, the speed difference, the security, the public certainly does not have the private security, saves on own hard disk is the most stable. In fact, in the intermediate time, I already talked about the creation of docker warehouse, this time using mac to achieve the creation of docker warehouse. Source code: https://github.com/limingios/msA-docker
Public warehouse
The most authoritative public warehouse is hub.docker.com.
Package docker tag zookeeper:3.5 zhugeaming/zookeeper:3.5docker logindocker push zhugeaming/zookeeper:3.5
Private Warehouse (1)
Https://hub.docker.com/_/registry/
Docker pull registry:2
Installation instructions
Official installation instructions
Docker run-d-p 5000R 5000-- name registry registry:2
Push to local registrydocker tag zookeeper:3.5 localhost:5000/zookeeper:3.5docker push localhost:5000/zookeeper:3.5
In the production environment, it can not meet the requirements, single sign-on, one server has a problem, the other server is very difficult to host, it does not have an interface, it is not very convenient for him to interact.
So there is a new harbor in the industry, which is more suitable for the production environment.
Private Warehouse (2)
Https://github.com/goharbor/harbor/
Looking down in detail, I finally gave up installing harbor directly under mac and installed harbor through the virtual machine of vagrant.
Preparatory work
Select offline installation
Cp Downloads/harbor-offline-installer-v1.6.1.tgz ~ / app/cd ~ / apptar-xvf harbor-offline-installer-v1.6.1.tgz
Modify the configuration file
Modify the red part
Cd harborllvi harbor.cfg
Convenient management, mac system management, modify storage path
Vi docker-compose.yml
Installation
Weird problem
Want to install a harbor on mac and download harbor-offline-installer-v1.6.1.tgz
Put the file in the / user/liming/app/ directory of the mac book, and unzip and modify the path to the configuration file and mount the file. When running install, you must add sudo, which is responsible for insufficient permissions. After adding sudu, you can install it normally and successfully. But the rest of the problem comes, the container inside cannot access the mounted configuration file, indicating that the permissions are insufficient. In order to make up for the lack of permissions, I have made configurations in docker-compose.yml and added them.
Privileged: true, but it doesn't work. I've been bothered for a few days that there is no docker around me. Help me with the answer.
Vagrant installation
Https://github.com/limingios/msA-docker/tree/master/vagrant/harbor
Modify host file and port without modifying port vi harbor.cfg
Vi docker-compose.yml
Install. / install.sh
Browse
Ifconfig
Visit harbor
Http://172.28.128.3:8888
User name: admin
Password: Harbor12345
All users exposed by library can push
Add project micro-service, private project
Click on the project to enter the project.
Adding a member project administrator equals admin developer equals push and pull permissions to the image of the project visitors equals only pull permissions
Copy function
In the production environment, many computer rooms, the network speed between each server room is very fast, but across the computer room, the stability and speed of the network speed may be poor. Each computer room deploys a harbor through a central harbor. When there is a mirror to automatically synchronize other servers, replication rules can be specific to the project, and each project has its own replication rules.
Create a user
Add member
Assign developers
Harbor is actually very simple to operate, and you can understand it by clicking on it at will.
Local micro-service image push
Now find a way to push all the images to mico-service.
Host file modification sudo vi / etc/hosts
Upload basic image
Hub.idig88.com has configured the foundation
Docker tag java:openjdk-8 hub.idig88.com:8888/micro-service/java:openjdk-8
The push refers to repository [hub.idig88.com:8888/micro-service/java] Get https://hub.idig88.com:8888/v2/: http: server gave HTTP response to HTTPS client configuration address: login to the server.
Vi / usr/lib/systemd/system/docker.service service docker restart
Configuration address: native mac. Click app& Restart after modification
Upload the basic image docker login http://hub.idig88.com:8888-u liming-p password docker push hub.idig88.com:8888/micro-service/java:openjdk-8docker tag python:3.6 hub.idig88.com:8888/micro-service/python:3.6docker push hub.idig88.com:8888/micro-service/python:3.6 again
Push micro-services to the warehouse
Now that the basic image is pushed to the image repository, you need to modify the corresponding dockerfile file and change the name of the basic image. Modify the configuration file
6 micro-service Dockerfile
From hub.idig88.com:8888/micro-service/
6 sh script modifications added push function
View the warehouse
All 8 images are in place.
PS: after 2 days and no less than 20 hours, I finally gave up installing harbor under mac. Always keep in mind that mac is just an editor. Don't install everything on it. In many cases, it is more similar to a generation environment through a virtual machine. After talking about the docker repository this time, start the service orchestration tool next time. It feels so good!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.