Docker Getting Started practice summary

Source: Internet
Author: User

Docker is a recent hot technology, it seems that no use of Docker is outdated, so I also in a personal project to use Docker, but also have some practical experience, to share with you.

The first is to install and configure the local Docker environment, because Docker is the Linux container engine, so the host must be Linux, Windows and Mac systems using Docker must first install Boot2docker to run a minimized Linux virtual machine with Docker dependencies as a host, but you can also run a full Linux desktop system with a virtual machine and then install Docker on it. The latter method is more recommended for individuals.

Domestic even Docker Hub pull mirror speed is relatively slow, we recommend the use of registration free Daocloud personal acceleration link, after registration can also have boot2docker accelerated download link.

If you want to run Docker on the server but you don't have a server, it is recommended to use Digitalocean's San Francisco VPS, register tutorial, Welcome to use my promotion link to register, you can get $10 after registration, equivalent to two months of free use of the minimum capacity of droplet, If you spend $25, I can get $25.

With the environment, if you want to learn Docker in the system, you can refer to the following books and series of articles.

    1. The first Docker book (watercress)
    2. Docker Technology Introduction and Combat (watercress) online reading
    3. The in-depth Docker series

Use Docker as much as possible to build the image using Dockerfile, create a github Repository for Dockerfile, and then use the Docker hub to associate to this GitHub Repository, you can automatically build the image, Each commit will trigger an automatic build. Large Dockerfile modifications before submitting to GitHub it is best to do a local walkthrough to avoid automatic build failures. Domestic network local running Docker image installation dependent program is slow, you can use the domestic mirror software source, for example, if it is Ubuntu can run the following command.

sed ‘s/archive\.ubuntu\.com/mirrors\.zju\.edu\.cn/‘ -i /etc/apt/sources.list

Some details of Dockerfile can be found in the official Dockerfile, such as Redis Dockerfile

As much as one container (mirror) is responsible for running an application, multiple containers can be simply allocated using FIG. For example, my Coolcantonese project uses 3 containers to run Python, Redis, and Nginx, respectively.

Fig.xml:

wechat:  image: kk17/coolcantonese  entrypoint: python  command: wechat.py  ports:    - "80:8888"  volumes:    - .:/Cantonese    - /Cantonese_audio  links:    - redisredis:  image: redisnginx:  image: nginx  volumes_from:    - wechat  volumes:    - configs/nginx.conf:/etc/nginx/nginx.conf:ro  ports:    - "9090:9090"

The above is my some basic practice of Docker, welcome to communicate more.
Personal blog Links

Docker Getting Started practice summary

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.