2. Modify the main configuration file/etc/grub of grub. conf, set default = 0, which indicates that the content in the first title is the default start kernel (generally, the newly installed kernel is in the first position ).
3. restart the system. At this time, your kernel is successfully upgraded.
1. First disable selinux:
setenforce0
sed
-i
'/^SELINUX=/c\SELINUX=disabled'
/etc/selinux/config
2. The docker-io package has been provided in the FedoraEPEL source. Download and install epel:
rpm-ivhhttp:
//mirrors
.sohu.com
/fedora-epel/6/x86_64/epel-release-6-8
.noarch.rpm
sed
-i
's/^mirrorlist=https/mirrorlist=http/'
/etc/yum
.repos.d
/epel
.repo
3. Install docker-io in yum:
yum-y
install
docker-io
4. Start docker:
servicedockerstart
5. view the docker version:
View docker logs:
cat
/var/log/docker
Iii. Use of docker commands
1. directly enter the docker command to view all Options and Commands.
View the detailed usage of a command: docker COMMAND -- help
2. search for available docker images: docker search NAME
3. Download the image: docker pull NAME [: TAG]
For example, get the latest centos image: docker pull centos: latest
Note: Enter the complete image name searched using docker search.
4. view the installed image: docker images [NAME]
5. run the COMMAND in the docker container: docker run IMAGE [COMMAND] [ARG...]
The docker run Command has two parameters: one is the image name and the other is the command to be run in the image.
Note: IMAGE = REPOSITORY [: TAG]. If the IMAGE parameter does not specify the image tag, the default TAG is latest.
Output "hello word": docker run centos echo 'Hello world! '
6. List containers: docker ps-
View the recently generated container: docker ps-l
View the running container: docker ps
7. display the container's standard output: docker logs CONTAINERID
You do not need to copy the complete id. Generally, the first three to four characters are required.
8. install a new program in the container, such as the ifconfig command (ifconfig is not installed in centos7 by default): docker run centos yum install net-tools-y
If the-y parameter is not specified for yum, the yum command enters the interaction mode. You need to enter a command to confirm that the interaction cannot be responded to in the docker environment. However, the-I-t parameter of docker run will respond to this interaction. You can enter the command, for example, docker run-I-t centos yum install net-tools.
9. Save the changes to the container and generate a new image: docker commit CONTAINERID [REPOSITORY [: TAG]
The REPOSITORY parameter can be a new image name or an old image name. If the old image name and TAG are the same, the old image will be overwritten.
10. stop a running container: docker stop CONTAINERID
By default, the specified container is killed after 10 seconds. You can use the-t parameter to set the wait time.
11. view the container or IMAGE details: docker inspect CONTAINERID | IMAGE
The parameter can be the container ID or image NAME (NAME: TAG ).
12. delete a container: docker rm CONTAINERID
View All container IDs: docker ps-a-q
Delete all containers: docker rm $ (docker ps-a-q)
13. delete an IMAGE: docker rmi IMAGE
14. View docker information, including the number of Containers, Images, and kernel versions.
4. Create a container and log on to the container
1. Create a new container and log on to: docker run-I-t IMAGE/bin/bash
Use the image to create a iner and enter the interactive mode. The login shell is/bin/bash. Now you can operate the container freely. Use exit to exit the container.
NOTE: If no TAG is specified for the IMAGE parameter, the default TAG is latest.
2. start an exited container: docker start CONTAINERID
3. attach to the running container: docker attach CONTAINERID
This article is from the "Departure Linux blog" blog, please be sure to keep this source http://qicheng0211.blog.51cto.com/3958621/1582909