Docker初步2 - Linux下安装
Docker初步2 - Linux下安装
·
http://archive.ubuntu.com/ubuntuwily
安装Docker
- Docker版本
Docker 从 17.03版本之后分为 CE(Community Edition) 和 EE(Enterprise Edition)。
Docker EE由公司支持,可在经过认证的操作系统和云提供商中使用,并可运行来自Docker Store的、经过认证的容器和插件。
Docker CE是免费的Docker产品的新名称,Docker CE包含了完整的Docker平台,非常适合开发人员和运维团队构建容器APP。 -- 个人使用,选择 Docker CE 版本 - 查看Linux版本
# cat /etc/issue
Ubuntu 16.04.1 LTS \n \l - 更新系统包列表
# apt-get update - 安装Docker - 1
即在https://get.docker.com执行安装的shell脚本,认真阅读提示信息。
# wget -qO- https://get.docker.com/ | sh
# Executing docker install script, commit: 442e66405c304fa92af8aadaa1d9b31bf4b0ad94
Warning: the "docker" command appears to already exist on this system.
If you already have Docker installed, this script can cause trouble, which is
why we're displaying this warning and provide the opportunity to cancel the
installation.
If you installed the current Docker package using this script and are using it
again to update Docker, you can safely ignore this message.
You may press Ctrl+C now to abort this script.
+ sleep 20
- 安装Docker - 2
# sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common -- 添加GPG密钥,使用Docker仓库repository
# sudo apt-get install -y docker-ce -- 安装Docker CE
- 确认Docker安装
# docker --version
# docker system info
Client:
Debug Mode: false
Server:
Containers: 2
Running: 0
Paused: 0
Stopped: 2
Images: 1
Server Version: 19.03.7
Storage Driver: overlay2
Backing Filesystem: <unknown>
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.4.0-83-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.762GiB
Name: *****
ID: WWVL:3LIB:ZZTF:PNUS:K4MU:JMCP:ZX43:OWYO:ATVG:YVSU:WLWW:MIYC
Docker Root Dir: /var/lib/docker
Debug Mode: false
Username: *****
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: No swap limit support
- 启动Docker并检查容器及服务
systemctl start docker
systemctl restart docker
systemctl stop docker - 选择存储器
- Device Mapper配置
Linux命令基础
- 切换用户:su(默认切换至root用户) / sudo(可以跳过root执行命令)
- 查看linux版本:uname -a # 显示系统信息
cat /etc/issue
cat /proc/version
cat /proc/cpuinfo
getconf LONG_BIT # 系统位数 32 bit / 64 bit - 进程
ps -a # 显示所有进程
sudo kill -9 进程号 进程号 # 中止进程
sudo kill sigkill 进程号 # 中止进程 - 删除文件:rm -rf # 如果无法控制或获得文件的控制权,除释放权限外,也可以删除该文件尝试
# unable to lock the administration directory - 应用
安装:sudo apt-get update 应用名
更新:sudo apt-get install -y 应用名 - 网络
netstat ###### 显示网络链接,路由表,网络统计,伪链接,传送节点
netstat -s # statistics
netstat -ant # all / numeric / tcp
netstat -tulpn # tcp / udp / listening / program / numeric
ss ###### 输出socket统计,可以显示更多 的TCP和stat信息
ss -s # summary
ss -u - t -a # udp / tcp / all
ss -l # listening
lsof ###### 显示当前系统打开的文件信息
tcptrack # 网络监控工具
iftop # 流量监控
ifconfig # 网络情况 - 帮助
help
man
更多推荐
所有评论(0)