A first look at docker

Reprinted from: http://www.linuxidc.com/Linux/2014-08/105654.htm

Due to the GFW relationship, when domestic users use docker, they pull down a basic image, let alone use the official index image. I almost gave up using docker, googled around, and finally found a way.

Step 1: Install docker

See the official guide or various Chinese guides

For example the following two:

Detailed explanation of the whole process of Docker's construction of Gitlab CIhttp  : //www.linuxidc.com/Linux/2013-12/93537.htm

Docker installation application ( CentOS  6.5_x64)  http://www.linuxidc.com/Linux/2014-07/104595.htm

Step 2: Create an image image from the file system

There are many ways to create an image. The official recommendation is to pull one, but GFW is helpless. I can't even download the next basic Ubuntu .

Another way is to import an image from a file system. Personally, it is recommended to use the opvz template to create:

The template download address of openvz is as follows:

http://openvz.org/Download/templates/precreated

centos-5-x86-devel.tar.gz (signature)2014-07-21 22:37:33197 Mb
centos-5-x86.tar.gz (signature)2014-07-21 22:36:20174 Mb
centos-5-x86_64-devel.tar.gz (signature)2014-07-21 22:39:56208 Mb
centos-5-x86_64.tar.gz (signature)2014-07-21 22:38:41184 Mb
centos-6-x86-devel.tar.gz (signature)2014-07-21 22:31:38234 Mb
centos-6-x86-minimal.tar.gz (signature)2014-07-21 22:30:16103 Mb
centos-6-x86.tar.gz (signature)2014-07-21 22:29:33203 Mb
centos-6-x86_64-devel.tar.gz (signature)2014-07-21 22:35:13249 Mb
centos-6-x86_64-minimal.tar.gz (signature)2014-07-21 22:33:48103 Mb
centos-6-x86_64.tar.gz (signature)2014-07-21 22:33:04215 Mb
centos-7-x86_64-minimal.tar.gz (signature)2014-07-21 22:41:55131 Mb
centos-7-x86_64.tar.gz (signature)2014-07-21 22:41:05201 Mb
debian-6.0-x86-minimal.tar.gz (signature)2014-07-21 22:26:5177 Mb
debian-6.0-x86.tar.gz (signature)2014-07-21 22:26:18148 Mb
debian-6.0-x86_64-minimal.tar.gz (signature)2014-07-21 22:28:2079 Mb
debian-6.0-x86_64.tar.gz (signature)2014-07-21 22:27:49150 Mb
ebian-7.0-x86-minimal.tar.gz (signature)2014-07-21 22:23:3784 Mb
debian-7.0-x86.tar.gz (signature)2014-07-21 22:23:05224 Mb
debian-7.0-x86_64-minimal.tar.gz (signature)2014-07-21 22:25:2284 Mb
debian-7.0-x86_64.tar.gz (signature)2014-07-21 22:24:49224 Mbf
edora-19-x86.tar.gz (signature)2014-07-21 22:11:34189 Mb
Fedora-19-x86_64.tar.gz (signature)2014-07-21 22:12:48190 Mb
fedora-20-x86.tar.gz (signature)2014-07-21 22:09:10184 Mb
fedora-20-x86_64.tar.gz (signature)2014-07-21 22:10:20184 Mb
scientific-6-x86.tar.gz (signature)2014-07-21 22:43:09197 Mb
scientific-6-x86_64.tar.gz (signature)2014-07-21 22:44:27210 Mb
SUSE-12.2-x86.tar.gz (signature)2014-07-21 22:04:06186 Mb
suse-12.3-x86.tar.gz (signature)2014-07-21 22:01:23190 Mb
suse-12.3-x86_64.tar.gz (signature)2014-07-21 22:02:47191 Mb
suse-13.1-x86-minimal.tar.gz (signature)2014-07-21 22:06:0955 Mb
suse-13.1-x86.tar.gz (signature)2014-07-21 22:05:43229 Mb
suse-13.1-x86_64-minimal.tar.gz (signature)2014-07-21 22:08:0356 Mb
suse-13.1-x86_64.tar.gz (signature)2014-07-21 22:07:35231 Mb
ubuntu-10.04-x86.tar.gz (signature) 2014-07-21 22: 19: 01133 Mb
ubuntu-10.04-x86_64.tar.gz (signature) 2014-07-21 22: 19: 52137 Mb
ubuntu-12.04- x86-minimal.tar.gz (signature) 2014-07-21 22: 17: 0357 Mb
ubuntu-12.04-x86.tar.gz (signature) 2014-07-21 22: 16: 38123 Mb
ubuntu-12.04-x86_64- minimal.tar.gz (signature) 2014-07-21 22: 18: 1358 Mb
ubuntu-12.04-x86_64.tar.gz (signature) 2014-07-21 22: 17: 50125 Mb
ubuntu-14.04-x86-minimal. tar.gz (signature) 2014-07-21 22: 14: 1873 Mb
ubuntu-14.04-x86.tar.gz (signature) 2014-07-21 22: 13: 48145 Mb
ubuntu-14.04-x86_64-minimal.tar. gz (signature) 2014-07-21 22: 15: 4975 Mb
ubuntu-14.04-x86_64.tar.gz (signature) 2014-07-21 22: 15: 17147 Mb

After downloading

For example: downloaded a mirror of ubuntu14.04

cat ubuntu-14.04-x86_64-minimal.tar.gz  |docker import - ubuntu:14.04

Then look at it with docker images:

docker images

 REPOSITORY          TAG                IMAGE ID            CREATED            VIRTUAL SIZE

 ubuntu              14.04              05ac7c0b9383        17 seconds ago      215.5 MB

Just one more of our ubuntu mirror

Step 3: Create a private repository

The official guide says the easiest way is docker run -p 5000:5000 registry, but we are in china

Thanks to CSDN, I have a 1M Tencent cloud server on which a private warehouse is built. You can use docker pull 203.195.193.251:5000/registry. Although the download speed to my server is slow, it is guaranteed.

Another method is to use the ubuntu created just now to create. There is an official docker https://github.com/dotcloud/docker-registry to  download the source code of the private warehouse. There are many ways to build the warehouse on the Internet.

Reference: http://www.linuxidc.com/Linux/2014-08/105653.htm

Step 4: push, pull

After creating your own private repository, you can use docker to tag an image, push it, and then pull it down on other machines. In this way, our local area network private docker warehouse is set up

What is the difference between Docker and a normal virtual machine?  http://www.linuxidc.com/Linux/2013-12/93740.htm

Using MySQL with Docker  http://www.linuxidc.com/Linux/2014-01/95354.htm

Docker will change everything  http://www.linuxidc.com/Linux/2013-12/93998.htm

Docker installation application (CentOS 6.5_x64)  http://www.linuxidc.com/Linux/2014-07/104595.htm

Detailed introduction of Docker : please click here
Docker download address : please click here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326449115&siteId=291194637