Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to build private server in docker

Shulou Source: shulou.com Published: 2022-06-02 05:52:14 10月02日 Update

This article introduces how to build a private server in docker, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Steps

Search for images: docker search registry

Pull image: docker pull docker.io/registry

Verification: docker images view list of local images

Run: external port 5000 runs in the background by default, alias registry

Docker run-p5000 5000-d docker.io/registry-- name=registry

Run validation:

Dcoker ps

Telnet Server IP 5000

Image upload private server (take image huahan/wx as an example) (registryHost refers to the domain name or Ip address of the private server)

Play tag:docker tag registryHost:5000/huahan/wx

Push: docker push registryHost:5000/huahan/wx

Run docker run-p 8080-d registryHost:5000/huahan/wx on the deployment machine

Problems encountered

Encountered the following error when uploading private server or downloading image

Error response from daemon: Get https://RegistryHost:5000/v2/: http: server gave HTTP response to HTTPS client.

Reason: https transmission is enabled by default for private servers, and the above error will occur in the ordinary http request method.

Solution: change the docker configuration file (/ etc/docker/daemon.json) and add the following configuration

"insecure-registries":\ ["registryHost:5000"\]

On how to build a private server in docker to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Mirror private server run content more error help configuration verification good normal interest alias reason backend address domain name such as above boy partner Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS NVidia MySQL Shulou Tech Info vpn