In the last article, the Docker pull CentOS command was executed, and after a while, the Docker's latest CentOS images was downloaded from hub.docker.com, followed by some basic Docker operations.
1, check the local images
Docker images
2, from the hub.docker.com pull response images
Docker Pull Images
3. Run the specified images and execute command commands inside the images
Docker Run Images command
4. View the container of the currently running images
Docker PS (-a View all) is shown below
5. Get log of container execution
Docker logs [options] Container
6. Get Container now process
Docker Top Container
7. Stop or kill the container in operation
Docker Stop\kill Container
8. View some information about the container
Docker Inspect container
The above command provides some insight into the basic operation of Docker,
An interactive Docker interactive operation is described below
will go into the container command-line interface, like the real operating system, with its own terminal, you can self-shell command and other columns from the operation
Execution exit, the container will exit, or execute ctrl+p, and then ctrl+q, can be kept in the background to run, using Docker PS can be queried, if you feel trouble, you can specify a name at run time:
Docker run-i-T--name containername images
Named ContainerName, using Docker PS, you can query to
When the container exits, the container is started again, and the Docker start command is required
Docker start Containerid or containername
After launch, the interface to the command terminal will not be entered, and the Docker attach command will be executed at this time
Docker attach Containerid or ContainerName
These are some of the basic things about Docker, and the next one will show you how to construct your own images and push it to hub.docker.com to prepare for a later test environment.
Using Docker to build a test environment--docker basic operations