docker安装和使用

int32位 posted @ Mar 22, 2016 03:34:22 PM in docker , 1663 阅读
转载请注明:http://krystism.is-programmer.com/若有错误,请多多指正,谢谢!

安装docker

测试环境: ubuntu14.04 64位

一命令式安装

wget -qO- https://get.docker.com/ | sh

把用户加入docker组

默认只有root用户能进行操作,不过docker组也具有权限,因此若需要当前用户不需要root 也能访问docker,需要把用户加入到docker组:

sudo usermod -a -G docker username

启动docker服务

sudo service docker start

测试是否安装好

docker info

若输出以下则说明安装成功

Containers: 0
Images: 0
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 0
Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.16.0-41-generic
Operating System: Ubuntu 14.04.2 LTS
CPUs: 4
Total Memory: 7.707 GiB
Name: Alibaba-fgp
ID: GA2K:3OV2:GNVU:PETS:DBZR:OYYP:FHWE:3QM5:QZPW:XNCM:IHP6:U2KN

启动第一个实例

docker run -t -i --rm busybox

此时应该会先从docker hub中拉取镜像,然后启动容器实例

其他命令

docker images #查看本地镜像
docker search hadoop #搜索hadoop相关镜像
docker pull krystism/openstackclient # 下载krystism/openstackclient镜像到本地
docker ps # 查看运行实例
docker ps -a # 查看所有实例,包括没有运行的
docker run -t -i ubuntu:14.04 # 运行ubuntu 14.04镜像
docker start id # 启动指定id实例(开机)
docker stop id # 停止指定id实例(关机)
docker rm id # 删除指定id实例(移除)
docker rmi id # 删除指定i镜像

 

转载请注明:http://krystism.is-programmer.com/若有错误,请多多指正,谢谢!
  • 无匹配
  • 无匹配
Canara Bank Balance 说:
2021年12月24日 17:55

In past days customers needed to visit a bank branch to know their account balance check after ATMs were implemented, and they became one of the sources to see the balance inquiry. Later, the internet spread to every place banking services digitized, so everything went online. Canara Bank Balance Check To ensure that all users can benefit from these services, the bank has developed many methods for accessing and checking bank data such as bank balance, Canara bank mini statement, latest transactions, etc.

Alyssa 说:
2022年12月30日 23:08

Docker is a tool that makes it easy to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package. Docker containers engagement rings can run on any machine and they are portable and consistent. Docker containers are created from images. An image is a file that contains all of the necessary code, libraries, and dependencies for an application. Images can be created by a developer or pulled from a repository, such as Docker Hub.

amarnath helicopter 说:
2024年6月06日 06:18

First You got a great blog .I will be interested in more similar topics. i see you got really very useful topics, i will be always checking your blog thanks.

tech 说:
2024年6月08日 01:57

It's late finding this act. At least, it's a thing to be familiar with that there are such events exist. I agree with your Blog and I will be back to inspect it more in the future so please keep up your act. côté européen d'istanbul


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter