Installation and use of Ubuntu14.04+docker _docker

Source: Internet
Author: User
Tags docker run

Installation

Officially recommended in Ubuntu installation, this article chooses the ubuntu14.04 as the host system.

System Update

Copy Code code as follows:

sudo apt-get update && apt-get upgrade-y
sudo reboot #最好重启一下

Install Docker

Copy Code code as follows:

Curl-s https://get.docker.io/ubuntu/| sudo sh

Basic command

Copy Code code as follows:

# download an Ubuntu image
sudo docker pull Ubuntu

Copy Code code as follows:

# Run an interactive shell using Ubuntu,
# Assign a pseudo terminal with stdin and stdout (input/output stream)
# If you want to quit the pseudo terminals that are separated,
# You can use Ctrl-p+ctrl-q--just like press ctrl-p and then ctrl-q
sudo docker run-i-T Ubuntu/bin/bash

-H can also authorize TCP bindings in a short way: host[:p ort] or:p ORT

Copy Code code as follows:

# Run Docker in daemon mode
sudo <path to>/docker-h 0.0.0.0:5555-d &
# Download an Ubuntu image
sudo docker-h: 5555 pull Ubuntu

You can be using multiple-H for example you want to monitor all of your TCP and UNIX sockets

Copy Code code as follows:

# Run Docker in daemon mode
sudo <path to>/docker-h tcp://127.0.0.1:4243-h unix:///var/run/docker.sock-d &
# Download An Ubuntu image, use default Unix socket
sudo docker pull Ubuntu
# OR Use the TCP port
sudo docker-h tcp://127.0.0.1:4243 pull Ubuntu

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.