8. docker image publishing and docker registry of private warehouse

A. Share image

1. Register Login docker hub

https://hub.docker.com/

2. Log in using locally registered docker login account and password input

3. docker push for push docker Repositories

  docker push [image_name]

4. pull to the remote mirror image uploaded

  docker pull [image_name] 

II. Private warehouse docker docker registry

  1. running on a remote server

    docker run -d -p 5000:5000 --restart always --name registry registry:2

  2. Make sure the remote server port 5000 is open

    telnet ip_address 5000 (the emergence of Connected ok)

  3. build a new image image

    docker build -t ip_address:5000/hello-world .

  4. Create daemon.json in the / etc / docker

    And write

    { "Insecure-registries": [ "ip_address: 5000"]} # trusted port 5000 in the ip

  5. Edit /lib/systemd/system/docker.service

    Add ExecStart = ... next

    EnvironmentFile=-/etc/docker/daemon.json

  6. Restart docker

    sudo systemctl daemon-reload

    sudo service docker restart

  7. docker push push mirror to their own private server

    docker push ip_address:5000/hello-world

  8. In the remote server to view the uploaded image (registry documents  https://docs.docker.com/registry/spec/api/ )

    After a review of that by visiting / v2 / _catalog can get access to all of the Mirror

    That browser or curl visit ip_address: 5000 / v2 / _catalog

    Get { "repositories": [ "hello-world"]}

    

Guess you like

Origin www.cnblogs.com/zonehoo/p/11283459.html