Installation and deployment of Ubuntu Docker and its simple application _docker

Source: Internet
Author: User
Tags commit gpg docker ps docker run

Docker is a dock worker. When it becomes a technology, it is a dock worker. The official website describes it as follows: "Docker is a platform developed to build, publish, and run distributed applications for developers and system administrators." "In other words, if you liken your application to goods, the Dockers will quickly load them with containers," Docker said. Fast, simple and efficient.

It is written in go language, is the "container" (Linux containers) of the program running, and implements the application level isolation (sandbox). Multiple containers run with complementary effects, safe and stable.

The reason I like it is rapid deployment, safe operation, not polluting my system.

Docker in Ubuntu deployment practice

This article describes the Docker deployment process on the Ubuntu system. Among them, Ubuntu for 12.04.5 LTS, Precise pangolin version.

1. Installation Docker

# apt-get Update
# apt-get install Docker.io
Reading Package lists ... Done
Building Dependency the    
Reading state information ... Done
e:unable to locate package Docker.io
e:couldn ' t find all package by regex ' Docker.io '

This shows that there is no Docker software in the software warehouse of Ubuntu 12.04. To retrieve information on the Web, Ubuntu 14.04 supports Docker. Installation requires a different approach without upgrading the OS.

However, the Docker in the software warehouse are usually not the latest version, and other installation methods can install the latest version of Docker.
Note: In the Ubuntu Software store, Docker is called Docker.io, because other software already occupies the name of Docker first.

 # Curl-ssl https://get.docker.com/ubuntu/| sudo sh executing:gpg--ignore-time-confli CT--no-options--no-default-keyring--secret-keyring/tmp/tmp. jo0wslsx8u--TRUSTDB-NAME/ETC/APT/TRUSTDB.GPG--KEYRING/ETC/APT/TRUSTED.GPG--PRIMARY-KEYRING/ETC/APT/TRUSTED.GPG --keyserver hkp://p80.pool.sks-keyservers.net:80--recv-keys 36a1d7869245c8950f966e92d8576a8ba88d21e9 GPG: Requesting key a88d21e9 from HKP server p80.pool.sks-keyservers.net gpg:key a88d21e9:public key ' Docker release Tool (re
Leasedocker) <docker@dotcloud.com> "Imported ...
Setting up Aufs-tools (1:3.0+20111101-1UBUNTU1) ...  Setting up Cgroup-lite (1.1.5) ... cgroup-lite start/running Setting up lxc-docker-1.7.1 (1.7.1) ... Docker start/running,
Process 10483 Setting up Lxc-docker (1.7.1) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place 

This command replaces the corresponding warehouse in Ubuntu with the latest version of the software warehouse provided by the Docker official. It is important to note that in this way, the Docker package name should be called Lxc-docker. At this point, the name of the Docker command is still Docker. and using the previous installation method, the Docker command name should be called Docker.io.

2, and then upgrade Docker

# sudo apt-get update && sudo apt-get upgrade

3. Add User Rights

If it is not the root user's action, you can add a user to the Docker user group, so that you do not need to use the sudo command to operate Docker. You can do this:

# sudo gpasswd-a USER Docker

4, check the installation of Docker

# Docker version
client version:1.7.1
client API version:1.19 go
version (client): go1.4.2
Git Commit (c lient): 786b29d
os/arch (client): linux/amd64
server version:1.7.1
server API version:1.19
go Version (server): go1.4.2
Git commit (server): 786b29d
os/arch (server): LINUX/AMD64

5. List the containers that are running

# docker PS
CONTAINER ID    IMAGE        COMMAND       CREATED       STATUS       PORTS        NAMES


6. List all containers (including running containers and containers that have been exited)

# Docker Ps-a

7. List local (downloaded and locally created) mirrors

# Docker Images

8. Run a new instance container from the mirror

# Docker Run

9. Stop a container

# Docker Stop

Thank you for reading, I hope to help you, thank you for your support for this site!

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.