Previous article K8S – Tutorial – Building production level Linux systems
Empty your cup so that it can be filled again. —— Bruce Lee
This paper introduces
P2 Build a production-level Linux system
P3 Learn Docker in half an hour
P4 Write Dockerfile and upload DockerHub
P5 Docker SpringCloud – compose deployment
P6 Build Harbor private server for enterprise mirror
P7 K8S & Rancher is coming! Theory & Preparation
P8 Rancher2.3 built K8S 1.16 cluster
P9 Deploy Spring Cloud to Kubernetes
P10 Deploy Vue to Kubernetes config ingress
P11 Ha01-rke install Kubernetes cluster
P12 HA02-Helm deploys the Rancher cluster
This set of content
Install the latest Dokcer
mirror
Port mapping
Directory mount
The log view
Container operation
Network related
Install the latest Dokcer
# Install Docker official source
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# update source
yum makecache fast
# installation
yum install -y docker-ce
Copy the code
解决 : yum install -y yum-utils
Then execute the installation of Docker official source
# Install Docker official source
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Copy the code
# update source
yum makecache fast
Copy the code
# installation
yum install docker-ce
Copy the code
# Set boot to boot
systemctl enable docker
# start
systemctl start docker
# check version
docker version
Copy the code
mirror
hub.docker.com
## 1. Download the imageDocker pull nginx: 1.17# Check local downloads
docker images
# delete mirrorDocker rmi nginx: 1.17## 2. Port operation# run container
docker run --name test-nginx -d -p 8080:80 nginx
# Host network
docker run --rm network host --name test-naginx2 nginx
## 3. Mount# run container
docker run --name test-nginx2 -d -p 8081:80 -v /data:/usr/share/nginx/html nginx
# entercd /data
# add file
vi index.html
# Add content to wq## 4. Log operations
docker logs -ftest-nginx
docker logs -fThe container ID## 5. Enter the container and exit# Enter container
docker exec -it test-nginx sh
# remove
docker rm test-nginx
Copy the code
If you cannot delete it, close it first and then delete it
docker stop test-nginx
docker rm -ftest-nginx
View the container details
docker inspect test-nginx2
## 6. Network operationView the container details
docker inspect test-nginx2
# Mirror busyBox tool
docker run -it --name test-nginx3 --link test-nginx busybox sh
Copy the code
# above
docker run -it --name test-nginx3 busybox sh
Copy the code
Form a complete set of data
Please pay attention to wechat (Java-note), message: K8S for supporting information