Using Docker to build a test environment--docker basic operations

Source: Internet
Author: User
Tags docker ps

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.