Docker basic commands for daily management of images, containers, and warehouses

Source: Internet
Author: User
Tags centos docker ps docker run

I. Basic commands for docker image operations
Take Image centos as an example

Search for docker search centos images
Download the image docker pull centos
Upload image docker push centos
Delete docker rmi centos
View image docker images
View the details of an image: docker inspect centos
Change tag docker. io/centos 21 yunwei: latest
Create an image docker commit Container ID image name
Save the image docker save-o testcentos.tar 21yunwei. latest
Load image docker load <tesetcentos.tar

2. Basic commands for docker container operations
Create container docker create-ti centos: latest set Container id to 3 adfasdfasdfasd
Start container docker start 3ad
Disable docker stop 3ad
Run the container docker run-ASD 3ad
Restart docker restart 3ad
View container docker ps or docker ps-
View container logs docker logs 3ad
Enter the container docker attach 3ad or docker exec-ti 3ad/bin/bash
Delete docker rm 3ad
Export container docker export 3ad> 21yunwei.tar
Import container cat 21yunwei.tar | docker import-test/centos: latest

3. Basic commands for docker warehouse operations
Build a local repository using registry

Docker run-d-p 5000: 5000/home/registry:/tmp/registry
Vim/etc/sysconfig/docker
Change the following code to add -- insecure-registry 192.168.2.75: 5000
OPTIONS = '-- selinux-enabled -- insecure-registry 192.168.2.75: 8080'

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.