菜鸟笔记
提升您的技术认知

docker安装-ag真人游戏

官方文档:https://docs.docker.com/

docker 支持多平台的安装(linux/windows/os x)。

因为docker原生支持linux,所以,可以直接在linux上运行,而且在windows和 os x 平台则需要借助轻量级的 linux vm 运行。

ubuntu在线安装docker

在ubuntu上安装docker的说明取决于您使用的是docker企业版(docker ee)还是docker社区版(docker ce)。

参考文档:https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/

使用仓库进行安装

首次在新的主机上安装docker ce之前,需要设置docker仓库。 之后,你可以从存储库安装和更新docker。

设置仓库

1、更新 apt 包索引:

$ sudo apt-get update 

2、安装软件包,使它允许apt通过https使用仓库:

$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common 

3、添加docker的官方gpg密钥:

$ curl -fssl https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 

通过搜索密钥的最后8个字符,确认您现在已经拥有指纹 9dc8 5822 9fc7 dd38 854a e2d8 8d81 803c 0ebf cd88 的密钥。

$ sudo apt-key fingerprint 0ebfcd88
pub   4096r/0ebfcd88 2017-02-22 密钥指纹 = 9dc8 5822 9fc7 dd38 854a e2d8 8d81 803c 0ebf cd88 uid docker release (ce deb)  sub 4096r/f273fcd8 2017-02-22 

4、使用以下命令来设置 stable 的仓库。即使你想从 __edge __ 或 test 仓库安装构建,也总是需要 stable 的仓库。要添加 __edge __ 或 test 仓库,请在下面的命令中在单词stable之后添加edge或test(或两者)。

$ sudo add-apt-repository \
  "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 

注意:上面的lsb_release -cs子命令返回你的ubuntu发行版的名字,比如xenial。

安装docker ce

1、更新 apt 包索引:

$ sudo apt-get update 

2、安装最新版本有 dcoker ce

$ sudo apt-get install docker-ce 

3、在生产系统上,您应该安装特定版本的docker ce,而不是始终使用最新版本。下面命令列出可用的版本。

$ apt-cache madison docker-ce
 docker-ce | 17.12.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 packages docker-ce | 17.09.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 packages docker-ce | 17.09.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 packages docker-ce | 17.06.2~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 packages docker-ce | 17.06.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 packages docker-ce | 17.06.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 packages docker-ce | 17.03.2~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 packages docker-ce | 17.03.1~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 packages docker-ce | 17.03.0~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 packages 

安装指定的版本:

$ sudo apt-get install docker-ce=<version> 

4、通过运行hello-world 镜像验证docker ce是否正确安装。

$ sudo docker run hello-world
unable to find image 'hello-world:latest' locally latest: pulling from library/hello-world ca4f61b1923c: pull complete digest: sha256:66ef312bbac49c39a89aa9bcc3cb4f3c9e7de3788c944158df3ee0176d32b751 status: downloaded newer image for hello-world:latest hello from docker! this message shows that your installation appears to be working correctly. to generate this message, docker took the following steps: 1. the docker client contacted the docker daemon. 2. the docker daemon pulled the "hello-world" image from the docker hub. (amd64) 3. the docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. the docker daemon streamed that output to the docker client, which sent it to your terminal. to try something more ambitious, you can run an ubuntu container with: $ docker run -it ubuntu bash share images, automate workflows, and more with a free docker id: https://cloud.docker.com/ for more examples and ideas, visit: https://docs.docker.com/engine/userguide/ 

其它

查看 docker 版本:

$ sudo docker version
client:
 version:	17.12.0-ce
 api version:	1.35
 go version:	go1.9.2
 git commit: c97c6d6 built: wed dec 27 20:11:19 2017 os/arch: linux/amd64 server: engine: version: 17.12.0-ce api version: 1.35 (minimum version 1.12) go version: go1.9.2 git commit: c97c6d6 built: wed dec 27 20:09:53 2017 os/arch: linux/amd64 experimental: false 

显示 docker 系统信息,包括镜像和容器数:

$ sudo docker info
containers: 7 running: 0 paused: 0 stopped: 7 images: 2 server version: 17.12.0-ce storage driver: aufs root dir: /var/lib/docker/aufs backing filesystem: extfs dirs: 20 dirperm1 supported: true logging driver: json-file cgroup driver: cgroupfs plugins: volume: local network: bridge host macvlan null overlay log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog swarm: inactive runtimes: runc default runtime: runc init binary: docker-init containerd version: 89623f28b87a6004d4b785663257362d1658a729 runc version: b2567b37d7b75eb4cf325b77297b140ea686ce8f init version: 949e6fa security options: apparmor seccomp profile: default kernel version: 4.13.0-26-generic operating system: ubuntu 16.04.3 lts ostype: linux architecture: x86_64 cpus: 1 total memory: 1.924gib name: ubuntu id: oxzy:hygr:x6xj:cldf:h2ug:kxcy:j6md:32wv:uorn:e2qy:trtl:isi6 docker root dir: /var/lib/docker debug mode (client): false debug mode (server): false registry: https://index.docker.io/v1/ labels: experimental: false insecure registries: 127.0.0.0/8 live restore enabled: false warning: no swap limit support


ubuntu离线安装docker

 安装依赖组件

更新apt-get源

sudo echo 'deb http://cz.archive.ubuntu.com/ubuntu trusty main' | sudo tee /etc/apt/sources.list

sudo apt-get update

 

安装libsystemd-journal0

sudo apt-get install -y libsystemd-journal0

 

安装libltdl7_2.4.6

sudo wget http://launchpadlibrarian.net/236916213/libltdl7_2.4.6-0.1_amd64.deb

sudo dpkg -i libltdl7_2.4.6-0.1_amd64.deb

 

安装docker

 

sudo curl -o https://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine_1.12.5-0~ubuntu-trusty_amd64.deb

sudo dpkg -i  docker-engine_1.12.5-0~ubuntu-trusty_amd64.deb

 

安装deb包 可以参考:ubuntu下安装软件的三种方法

网站地图