docker 文章参考

来源:互联网 发布:博威造价软件 编辑:程序博客网 时间:2024/05/22 06:55

docker for windows 安装指南:https://docs.docker.com/docker-for-windows/

docker 简述:https://waylau.com/ahout-docker/

docker 中文指南(翻译中):http://www.widuu.com/chinese_docker/userguide/dockerizing.html

docker 镜像服务使用指导:http://www.oschina.net/news/57894/daocloud

国内免费docker 镜像服务:https://dashboard.daocloud.io/  极大提升拉取镜像速度。

CSDN docker 社区:http://docker.csdn.net/

打包jar 包成image 【docker-maven-plugin】:http://www.cnblogs.com/puroc/p/5799228.html

[译] 深入理解 Docker Volume(一):http://www.tuicool.com/articles/uYzeAnz

Docker 学习笔记:http://blog.opskumu.com/docker.html


命令:
启动 ubunu 终端: docker run -t -i ubuntu /bin/bash
删除untagged images,也就是那些id为 none 的image的话可以用:docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
删除所有 container :docker rm $(docker ps -a -q)



问题:
1、E: Unable to locate package:无法找到包, apt-get update下!
2、异常信息
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
在命令前加 "DEBIAN_FRONTEND=noninteractive " 取消交互。参考


#启动镜像并进入容器

$ sudo docker run -itd --name=ubuntu ubuntu

run命令选项:

-t 模拟一个终端,-i进入这个容器,一般结合使用创建一个交互式容器。

-d 后台运行容器并打印ID,如果不加-i后面就不能附加进入容器

--name 为容器指定名称

run命令选项很多,先不过多介绍,在使用中你会慢慢了解到!

此时你已经创建并进入容器,怎么能退出呢?

# 按ctrl+d退出容器,会暂停容器,可以再启动(sudo docker start ID/NAME),里面数据不会丢失。

# 退出暂停容器太不符合常理啊!那么按ctrl+p+q退出docker,将不会暂停

#紧接查看运行的容器

$ sudo docker ps

#这时想进入某个容器可通过ps查看的ID进入运行的容器

$ sudo docker attach ID/NAME

#关闭运行的容器(start/restart)




0 0
原创粉丝点击