Docker Common Commands Collation

Source: Internet
Author: User
Tags docker ps docker cp docker hub docker run

1. View the image

Docker images

2. View containers for all States

Docker Ps-a

3. Running the container

Docker exec-it Container/bin/bash

Docker attach container (not recommended, abnormal exit easy to die, and single-user use)

Exit Ctrl+p+q

4. Make container image

Docker Commit Container Image-name

5. Image Packaging

Docker Save Zhoumingang_tempest_v1 >/root/zhoumingang_tempest_v1.tar

6. Copy the file SCP within Docker

When the container is closed, the files in it can be copied.

sudo docker CP 7bb0e258aefe:/etc/debian_version

7. Create a new image

Dockerload-i File.tar

8. Start the Docker image

Docker run-u root-it-v/root/lihao:/root/result image_name (-V is to mount the host's directory when the volume is mounted to Docker)

9. Search the Docker hub image

Docker Search Rally

Docker pull Download

Docker Common Commands Collation

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.