CentOS install Docker and Docker base commands

Source: Internet
Author: User
Tags docker ps docker run

Installation

RPM-IVH http://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

Yum-y Install Docker-io

Service Docker start

Basic commands

Docker search looks for mirrors in the warehouse

Docker Pull Fetch image

Docker Run Runtime container

Docker PS Viewing a running container

Docker ps-l View all containers

Docker commit to submit container image (with unique number to commit)

Docker inspect ID view container or mirror details, running all parameters of the container

to start an exit container : Docker start Containerid

Attach to a running container: Docker attach Containerid

Create a new container and log in: Docker run-i-T Image/bin/bash

Docker push saves a new image into the warehouse


    • Install new programs in the container, such as installing the Ifconfig command (CENTOS7 does not have ifconfig by default): Docker run CentOS yum install net-tools-y


If Yum does not specify the-y parameter, the yum command enters interactive mode and requires the user to enter a command to confirm that the interaction cannot be responded to in the Docker environment. But using the-i-t parameter of Docker run responds to this interaction, and the user can enter commands such as Docker run-i-T CentOS Yum install Net-tools


Startup configuration file

/etc/default/docker



This article from "Life, such as painting, Pen no regrets!" "Blog, be sure to keep this provenance http://521angela.blog.51cto.com/9680035/1783980

CentOS install Docker and Docker base commands

Related Article

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.