How to use domestic image warehouse for Docker

How to use domestic image warehouse for Docker

1. Problem description

Due to some reasons, the download speed of Docker images in China is particularly slow. So for immersive development. It is best to switch to a domestic source. Here we take the 163 mirror repository as an example. First modify the /etc/docker/daemon.json configuration file.

sudo vi /etc/docker/daemon.json

Replace the content of this file with Alibaba source. The modified /etc/docker/daemon.json file is:

{
  "registry-mirrors": ["http://hub-mirror.c.163.com"]
} 

insert image description here

Then systemctl restart docker restart Docker command. Then use the docker info command to view the image warehouse information. The results are as follows:

root@ubuntu:~# docker info
Client:
 Debug Mode: false

Server:
 Containers: 3
 Running: 0
 Paused: 0
 Stopped: 3
 Images: 3
 Server Version: 19.03.8
 Storage Driver: overlay2
 Backing Filesystem: <unknown>
 Supports d_type: true
 Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
 appArmor
 seccomp
  Profile: default
 Kernel Version: 4.15.0-97-generic
 Operating System: Ubuntu 18.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 7.767GiB
 Name: ubuntu
 ID: 2XV6:BJ7Q:6BIH:4FIR:HEPL:3GF7:33A2:GGTU:EQMB:EKGX:EO34:5J44
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
 127.0.0.0/8
 Registry Mirrors:
 http://hub-mirror.c.163.com/
 Live Restore Enabled: false

WARNING: No swap limit support 

insert image description here

2. Summary

Most of the code in the book is correct if you run it directly, but there are always some software updates that the author cannot do anything about. It is common that the previous API was correct, but it was later abandoned or modified. So we need to track the source code. This is just a small question. Without the selfless dedication of our predecessors, it is hard to imagine how much we can learn in a day. Thank you to all the seniors for their hard work, which helped us avoid many detours!

This is the end of this article about how to use domestic image repositories with Docker. For more relevant content about domestic image repositories with Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to use Docker buildx to build multi-platform images and push them to private repositories
  • Use Docker to build a Git image using the clone repository
  • Jenkins builds Docker images and pushes them to Harbor warehouse
  • docker-maven-plugin packages the image and uploads it to a private warehouse
  • How to use Docker image repository
  • Alibaba Cloud deployment steps for Docker private image repository
  • Docker container practice image warehouse

<<:  Vue implements the drag and drop sorting function of the page div box

>>:  Example code for implementing card waterfall layout with css3 column

Recommend

Mysql optimization Zabbix partition optimization

The biggest bottleneck of using zabbix is ​​the d...

A brief analysis of the differences between px, rem, em, vh, and vw in CSS

Absolute length px px is the pixel value, which i...

Docker learning: the specific use of Container containers

Container is another core concept of Docker. Simp...

Methods and techniques for designing an interesting website (picture)

Have you ever encountered a situation where we hav...

WeChat applet uses canvas to draw clocks

This article shares the specific code of using ca...

Common problems and solutions during MySQL MGR construction

Table of contents 01 Common Faults 1 02 Common Fa...

Summary of solutions to common Linux problems

1. Connect Centos7 under VMware and set a fixed I...

Prometheus monitors MySQL using grafana display

Table of contents Prometheus monitors MySQL throu...

js to achieve simple calendar effect

This article shares the specific code of js to ac...

How to install vncserver in Ubuntu 20.04

Ubuntu 20.04 has been officially released in Apri...

WeChat applet realizes taking photos and selecting pictures from albums

This article shares the specific code for WeChat ...

How to run top command in batch mode

top command is the best command that everyone is ...

Shell script nginx automation script

This script can satisfy the operations of startin...

6 inheritance methods of JS advanced ES6

Table of contents 1. Prototype chain inheritance ...