A, docker installation and uninstallation
1. Check the kernel version: uname -r
2. Update the local repository: apt-get update
3. 安装docker:apt-get -y install docker.io
4. docker start: systemctl start docker
5. docker from the start: systemctl enable docker
6. Check the version docker: docker version
7. Uninstall:
GET-APT - the y-// docker.io the Remove to uninstall the software RM -r / var / lib / Docker / // delete data files RM -r / etc / Docker / // delete data files
Second, mount the system disk:
1. Mount the new hard disk;
2. Check the list of available hard disk: fdisk -l
3. The new data disk partition: (n, p, l, carriage, carriage return, WQ)
fdisk /dev/sdb
4. When the partition is complete, you can find the corresponding disk information: fdisk -l
5. After partitioning, formatting: mkfs.ext3 / dev / sdb1
6. The partition information is added: echo '/ dev / sdb1 / mnt ext3 defaults 0 0' >> / etc / fstab
At this time, after the mount is completed, the current system disk path "/ mnt"
7. View the partition information: cat / etc / fstab
8. mount the disk partition: mount -a
9. Review the current disk information: df -h
The display docker information (storage directory): docker info
11. Modify the default path docker:
mkdir -p /mnt/data/docker/storage
vim /etc/systemd/system/multi-user.target.wants/docker.servic
"Modify information:
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock //原来 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --graph=/mnt/data/docker/storage --storage-driver=overlay //修改为
"File Copy: cp -r / var / lib / docker / * / mnt / data / docker / storage
12. Configure aliyun docker-ubuntu mirror Acceleration:
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://xujvirmd.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
13. Review the docker information:
docker info
http://192.168.195.172:2375/info
Three, docker operation command:
1. Review the current host mirror information: docker images
2. docker process the query:
Mirror docker ps // running Docker PS - A // has not completely ended mirrored Docker PA -a -q // has not completely ended the Mirror, Mirror id
3. mirror-off:
the kill $ docker (PS -a docker - q) // end all running docker
docker RM $ (docker PS -a -q) // Clear docker run information
4. Start the container terminal docker docker operating system:
docker run -it --rm ubuntu
-i: Start a new command to the terminal in a container, -t: a user operating the terminal directly, -rm: to shut down after the container is closed completely, the background will not be retained in the docker
5. Get the current version of ubuntu system: cat / etc / issue