Docker private repository under Linux

Source: Internet
Author: User
Tags docker run

Environment preparation
    • Use two machines, one to do Docker private warehouse, one to do Docker image submission
    • Make sure Docker is installed on both machines and start the Docker service
    • The name of the Docker private warehouse is: Docker-registry, IP: 192.168.1.101
    • The Docker image is submitted with the name: Docker-app, IP 192.168.1.102
Installation of private warehouses and push of mirrors
  • Execute the following command on the Docker-registry machine:
    docker run --name docker-registry -d -p 5000:5000 registry
  • Change the contents of the/etc/default/docker file on the Docker-app machine:
    DOCKER_OPTS="--insecure-registry 192.168.1.101:5000 --dns 114.114.114.114"

  • Modify the/lib/systemd/system/docker.service file to support the modified Docker configuration file to use the HTTP protocol

    EnvironmentFile=-/etc/default/dockerExecStart=/usr/bin/dockerd -H fd:// $DOCKER_OPTS
  • Reload Docker service and restart Docker service
  • Pull an image on the Docker-app machine, such as Nginx or Tomcat
  • Then look at the ID of the image
  • Use this image as a marker for push
    docker tag IMAGE_ID 192.168.1.101:5000/nginx
  • Then push to the warehouse:
    docker push 192.168.1.101:5000/nginx

  • To see if it was successful:curl -X GET http://192.168.1.101:5000/v2/_catalog
  • Delete Local Image:docker rmi tomcat 192.168.1.101:5000/tomcat
  • To run the image of a private warehouse on Docker-app:docker run --name nginx01 -p 80:80 -idt 192.168.1.101:5000/nginx

Docker private repository under Linux

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.