docker ubuntu 开发环境搭建
OS:win10 pro X64
安装docker ce for Windows,采用Linux container,默认配置。
- docker run --network host -i -t ubuntu即可进入ubuntu-16.04.3命令行,用户为root。-i表示交互,否则无法输入内容到命令行;-t表示通过terminal进行交互;--network host可以加快apt-get update的速度?
- apt-get update && apt-get install apt-transport-https
-
mv /etc/apt/sources.list /etc/apt/sources.list.bak备份原来的更新源;
cat > /etc/apt/sources.list << "EOF"
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiversedeb https://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiversedeb https://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiversedeb https://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverseEOF
apt-get update 更新源。
- docker commit containerID repo:tag生成一个image,否则在当前container停止后其中所做的更改都会消失。
作者:glob
出处:http://www.cnblogs.com/adera/
欢迎访问我的个人博客:https://blog.globs.site/
本文版权归作者和博客园共有,转载请注明出处。