Li Chipress: I have hardly updated my blog since I started my new job. In the new unit, I contacted, learned and used Docker one after another, and then implemented containerized development. Based on Docker CICD, I learned about Kubernetes and began to study docker source code. As time goes by, more than half a year has passed, and I have some experience in using Docker. This series of articles is about Docker, documenting the technical dribs and drabs associated with it. Since it is an essay rather than a tutorial, it may be a little rough and simple, and will not involve too much technical principles. After all, I am not young, and I have few academic habits, so I mainly focus on solving practical problems. Write out, on the one hand is to provide future reference, work for many years, for some knowledge points, I still have to look at the old article to find a way. On the other hand, there are various and uneven materials about Docker on the Internet, some are wrong and some are not practical, so I want to write with my own practical experience. Moreover, if can help one or two net friends, that is glad thing, but in case of mislead a person’s children, but not original intention. In awe, treading on thin ice, improper place, hope to point out criticism, the author according to the actual situation correction.

tips

  1. Everyone has a different view of Docker. However, some materials and books seem to exaggerate their role. For me, Docker plays a very important role in some development environments and application situations where programs run.
  2. Docker develops very fast. Some books on the market use older versions, and some online materials are also outdated. It is recommended to read clearly the version number and writing time of Docker (of course, this also includes this series of articles). It is also recommended to look at official documentation.
  3. Docker is slow to download in China, but accelerators in the domestic mirror market (such as Aliyun Accelerator) can be used to improve the speed.
  4. Docker official mirror market, can cooperate with GitLab or Github for automatic construction, and the generated Docker image is stored on DockerHub.
  5. For the code or script is not convenient to public and do not want to spend money to host the image, you can use GitLab to host the code, and use Ali Cloud image service (this service is free).
  6. Google has its own Docker image market (GCR images are heavily used in Kubernetes applications), but it is almost inaccessible in China for well-known reasons. However, you can use DockerHub as a conduit.

Experience with

March 2021: Docker and Docker-compose: If it is a simple verification, docker can be directly run. If it is used in practice, it is recommended to use Docker-compose, which is convenient and quick.

Time zone: Generally, the mirror time zone is UTC. If you pass the parameter when running the container, set the time zone. Such as East District 8:

environment:
  - TZ=Asia/Shanghai
Copy the code

Resources

Docker Warehouse base: hub.docker.com/ or hub.docker.com/

Personal accumulated resources are as follows (will be updated continuously) :

Docker-compose file: github.com/latelee/doc…

Dockerfile file: github.com/latelee/doc…

Personal docker mirror: hub.docker.com/u/latelee/

Personal Ali Cloud mirror warehouse address:

registry.cn-hangzhou.aliyuncs.com/latelee  
Copy the code

Login ali Cloud mirror warehouse command:

docker login [email protected] registry.cn-hangzhou.aliyuncs.com  
Copy the code

Personal Docker acceleration address:

https://a8qh6yqv.mirror.aliyuncs.com  
Copy the code