Docker 基础使用入门
搜索某个镜像:
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 的详细介绍:请点这里
Docker 的下载地址:请点这里