背景:
阅读新闻
Docker 基础使用入门
[日期:2016-12-30] 来源:Linux社区 作者:chengtai [字体:]
搜索某个镜像:
docker search busybox
拉取:
docker pull busybox
查看:
docker images
启动并运行:
docker run -it busybox:latest /bin/sh
docker 的常用命令:
环境信息相关:
docker info
docker version
系统维护相关:
images
inspect
build
commit
pause/unpause
ps
rm
rmi
run
start/stop/restart
top
kill
...
日志信息相关:
events
history
logs
Docker hub服务相关:
login
logout
pull
push
search
基本操作:
获取映像:pull
启动容器:run
-i ,-t 交互式
结束一个正在运行的docker容器
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
70f37e4e3742 busybox:latest "/bin/sh" 50 minutes ago Up 50 minutes prickly_borg
[root@localhost ~]# docker kill 70f37e4e3742
70f37e4e3742
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
70f37e4e3742 busybox:latest "/bin/sh" 50 minutes ago Exited (137) 9 seconds ago prickly_borg
dockerfile
更多Docker相关教程见以下内容:
Docker安装应用(CentOS 6.5_x64)
Ubuntu 14.04安装Docker
在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker