Docker in Ubuntu deployment practice Chszs, copyright, without consent, may not be reproduced. Blogger Home: Http://blog.csdn.net/chszs
This article describes the deployment process for Docker on Ubuntu systems. Among them, Ubuntu is 12.04.5 LTS, precise pangolin version.
1. Installing Docker
# apt-get update# apt-get install docker.ioReading package lists... DoneBuilding dependency tree Reading state information... DoneE: Unable to locate package docker.ioE: Couldn‘t find any package by regex ‘docker.io‘
Shows that there is no Docker software in the Ubuntu 12.04 software repository. Retrieving information on the Web, Ubuntu 14.04 is supported by Docker. Without upgrading the OS, an additional approach is required for installation.
However, Docker in the software warehouse is usually not the latest version, and the latest version of Docker can be installed in other ways.
Note: In Ubuntu's software repository, Docker is called Docker.io because there are already other software that occupy the name of Docker first.
# Curl-ssl https://get.docker.com/ubuntu/| sudo shexecuting:gpg--ignore-time-conflict--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 36A1D7869245C8950F966E92D8576A8BA88D21E9GPG: Requesting key a88d21e9 from HKP server P80.pool.sks-keyservers.netgpg:key a88d21e9:public key "Docker Release Tool (rel Easedocker) <[email protected]> "Imported ... Setting up Aufs-tools (1:3.0+20111101-1UBUNTU1) ... Setting up Cgroup-lite (1.1.5) ... cgroup-lite start/runningsetting up lxc-docker-1.7.1 (1.7.1) ... docker start/running, p Rocess 10483Setting up Lxc-docker (1.7.1) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place
This command will replace the repository of Ubuntu with the latest version of the software repository that is officially provided by Docker. One thing to note is that this is the way to install the Docker package name should be called Lxc-docker. At this point, the name of the Docker command is Docker. The name of the Docker command should be called Docker.io, using the previous installation method.
2. Re-upgrade Docker
# sudo apt-get update && sudo apt-get upgrade
3. Add User Rights
If it is not the root user's operation, you can add a user to the Docker user group so that you do not need to use the sudo command to operate Docker. Can do this:
# sudo gpasswd -a USER docker
4, check the installation of Docker
# docker versionClient version: 1.7.1Client API version: 1.19Go version (client): go1.4.2Git commit (client): 786b29dOS/Arch (client): linux/amd64Server version: 1.7.1Server API version: 1.19Go version (server): go1.4.2Git commit (server): 786b29dOS/Arch (server): linux/amd64
5. List the containers that are running
# docker psCONTAINER 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
Copyright NOTICE: This article for Bo Master Chszs original article, without Bo Master permission not reproduced.
Docker deployment practice in Ubuntu