1. docker软件安装
a. 更新apt包目录
$ sudo apt-get update
b.安装https支持
$ sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
c. 添加Docker的官方GPG Key
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
d.验证密钥
$ sudo apt-key fingerprint 0EBFCD88
e. 添加Docker的apt安装源
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
f.安装Docker
$ sudo apt-get update
$ sudo apt-get -y install docker-ce
g. 测试是否安装成功
$ sudo docker run hello-world
2. 查看Docker版本
$ sudo docker version
$ sudo docker version
$ sudo docker info
3. 当前用户加入 docker 用户组,无需每次运行sudo。
a. sudo usermod -aG docker $USER
b. sudo groupadd docker
sudo gpasswd -a $USER docker
newgrp docker
docker ps
4. Ubuntu系统版本查询
版本查看:cat /etc/issue
Ubuntu 10.04 LTS自带的gcc4.4.3版本
5. 获取基础镜像
6. 创建容器时,挂载当前用户的路径映射到容器的/home/echo上,方便后面拷贝文件
a. docker run -it -v ~/:/home/echo ubuntu:10.04 /bin/bash
b. docker run -p 10022:22 -it --name docker_u10 -v ~/:/home/echo ubuntu:10.04 /bin/bash
7. 系统基本配置
a. 更正时区
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo 'Asia/Shanghai' >/etc/timezone
b. 更换系统源
cp /etc/apt/sources.list /etc/apt/sources.list.bak
sed 's/archive/old-releases/g' /etc/apt/sources.list.bak>/etc/apt/sources.list
8. docker 保存
docker commit df554fb99000 ubuntu:10.04
9. docker使用基本命令
exit //退出docker
docker run //创建、启动容器
docker ps -a //查看刚刚运行的容器的id
docker start f5df2d39fca4 //启动容器
docker exec -it f5df2d39fca4 /bin/bash //进入容器终端
service docker restart //重启docker服务
10. 设置系统自启动 docker,默认已配置。
11. docker运行效果优化
a. 提升下载速度
改一下docker服务的配置文件就行
Ubuntu默认在 /etc/default/docker
在末尾加
--registry-mirror=https://registry.docker-cn.com
12. 备用更新源
## Major bug fix updates produced after the final release of the
## distribution.
deb http://old-releases.ubuntu.com/ubuntu/ maverick main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick main restricted
deb http://old-releases.ubuntu.com/ubuntu/ maverick-updates main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://old-releases.ubuntu.com/ubuntu/ maverick universe
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick universe
deb http://old-releases.ubuntu.com/ubuntu/ maverick-updates universe
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://old-releases.ubuntu.com/ubuntu/ maverick multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick multiverse
deb http://old-releases.ubuntu.com/ubuntu/ maverick-updates multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick-updates multiverse
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://us.old-releases.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse
# deb-src http://us.old-releases.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse
#remastersys for backup installed system
deb http://www.remastersys.com/ubuntu maverick main
13. 名词解释
PGP(英语:Pretty Good Privacy,中文含义“良好隐私密码法”)
GNU Privacy Guard (简称GnuPG或GPG)是一种加密软件
14. 交叉编译环境搭建
a. 基本工具
b. 平台依赖工具