博客
linux安装docker
2020-07-07 12232 0
简介 1、用yum源安装 查看是否安装命令 yum list installed | grep docker 安装docker命令 yum -y install docker -y表示不询问安装 启动docker命令 systemctl start...
1、用yum源安装
查看是否安装命令
yum list installed | grep docker
安装docker命令
yum -y install docker
-y表示不询问安装
启动docker命令
systemctl start docker
查看docker服务状态
systemctl status docker
2、离线安装模式
上传或者下载安装包
wget https://download.docker.com/linux/static/stable/x86_64/docker-18.06.3-ce.tgz
解压 复制到目录
tar -zxvf docker-18.06.3-ce.tgz
cp docker/* /usr/bin/
在/etc/systemd/system/目录下新增docker.service文件 这样可以将docker注册为service服务
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd --selinux-enabled=false --insecure-registry=127.0.0.1
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
授权
chmod +x /etc/systemd/system/docker.service
启动docker
重新加载配置文件 systemctl daemon-reload
启动systemctl start docker
systemctl daemon-reload
systemctl start docker
设置开机启动
systemctl enable docker.service
3、docker命令
进入镜像命令docker exec -it 89c5b9c81e74 bash
启动容器 docker run --name nginx
停止容器 docker stop nginx
删除容器 docker rm nginx
信息查看 docker info
[root@10-9-25-182 ~]# docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.06.3-ce
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: a592beb5bc4c4092b1b1bac971afed27687340c5
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.18.0-147.5.1.el8_1.x86_64
Operating System: CentOS Linux 8 (Core)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.701GiB
Name: 10-9-15-182
ID: 3VIG:ANXE:JRSP:OXY6:QJJG:UI4F:XFFE:GJO2:KRKX:INJJ:NTPN:BTRK
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.1
127.0.0.0/8
Live Restore Enabled: false
备注:
如果报错找不到 docker.service
Failed to start docker.service: Unit docker.service not found.
参考这篇文章 https://blog.csdn.net/qiao_xinxin/article/details/114943904
标签云
- 分享(4)影视(4)测试(1)云标签(0)markdown(0)SpringBoot(21)SpringBoot启动失败(1)springboot解析json(1)orm(1)java(4)linux(8)防火墙(1)linux防火墙(1)iptables(1)firewall(1)docker(8)创建docker镜像(1)docker安装redis(1)nginx(5)linux命令(1)源码解读(2)git(1)记录(3)酷玩(9)测试公众号(1)小工具(7)酷玩软件(5)ColorPix(1)size(1)身份证生成器(1)源码(2)抖音H5源码(1)仿抖音H5(1)酷玩代码(8)多线程(2)流媒体服务器(1)直播(2)nacos(3)微服务(5)数据库(3)面试(3)zookeeper(1)公众号爬虫(50)爬虫(1)三十而已(1)每日一冷(26)冷兔(12)JDK8新特性(1)lambda详细解析(1)九一八79周年纪念(1)fc(1)jsnes(1)在线玩fc游戏(1)没有比大人更大的人(1)感动(1)生活不易(1)GBA模拟器(1)标签云(1)源码分享(3)动态头像(1)固定url动态图片(1)docker安装mysql(2)navicat链接1251(1)Minio(1)docker安装Minio(1)扫码发短信(1)发短信html(1)网站建设(1)微信刷步(1)wordpress(1)docker安装wordpress(1)酷玩工具(2)Honeyview(1)蜂蜜浏览器(1)SumatraPDF(1)装机工具(1)学习资料(1)小游戏(1)mysql(4)linux安装mysql(1)前端模板(1)dock(1)PowerDesigner(1)破解汉化(1)SpringBoot启动流程(1)SpringBoot自动装载(1)sitemap(1)seo(1)趣味代码(1)fc游戏机(1)小霸王游戏机(1)朋友圈的空调(1)nginx配置黑名单(1)博客嵌入B站视频(1)jQueryTOC(1)Redis面试题(0)Redis(0)吊打面试官(1)mysql8忽略大小写(1)在线玩魔方(1)代码分享(1)Springboot部署windows(1)端口占用(1)QQxml卡片消息发送教程(1)QNotified(1)太极(1)QQ卡片代码(1)九一八(1)远程打卡(1)虚拟定位(1)日记(1)rocketmq(1)消息队列(1)fastdfs(1)office(1)小技巧(1)音乐(1)抖音视频解析(1)无水印下载抖音视频(1)轻量网盘(1)临时邮箱(1)验证码代收(1)Spacedesk(1)Typora(1)视频下载(2)灌篮高手(1)视频流下载(2)散列值(1)数字签名(1)HASH(1)迪迦奥特曼(1)zhihu(2)小说(1)代码优化(1)刷机(1)知乎(1)纪实(1)openssl(1)工作笔记(1)小巷人家(1)视频(1)社保(1)时政(1)AI(1)回表(1)索引覆盖(1)八股文(1)SpringCloud(1)B站(0)AIMV(0)B站(0)AIMV(0)B站(0)AIMV(0)B站(0)AIMV(0)B站(1)AIMV(1)Redis面试题(0)Redis(0)吊打面试官(0)面试(0)Redis面试题(1)Redis(1)吊打面试官(1)面试(1)
文章评论
最近更新
- 11-22 赵本山《Bad Guy》让铁岭再次伟大
- 11-18 16G+512G“公认很香”,目前3款“值得闭眼入”的手机,双11重点考虑
- 11-17 Springboot 属性配置和优先级
- 08-26 微服务相关
- 07-08 在Mysql中,什么是回表,什么是覆盖索引,索引下推
- 05-05 Claude Code 命令大全
- 04-22 从零开始看懂 AI
- 08-07 不是你需要社保,而是社保需要你了
- 06-02 Controller层代码瘦身70%!5招打通任督二脉,效率飙升
- 11-09 《小巷人家》全集视频下载代码
标签云
- 分享(4)影视(4)测试(1)云标签(0)markdown(0)SpringBoot(21)SpringBoot启动失败(1)springboot解析json(1)orm(1)java(4)linux(8)防火墙(1)linux防火墙(1)iptables(1)firewall(1)docker(8)创建docker镜像(1)docker安装redis(1)nginx(5)linux命令(1)源码解读(2)git(1)记录(3)酷玩(9)测试公众号(1)小工具(7)酷玩软件(5)ColorPix(1)size(1)身份证生成器(1)源码(2)抖音H5源码(1)仿抖音H5(1)酷玩代码(8)多线程(2)流媒体服务器(1)直播(2)nacos(3)微服务(5)数据库(3)面试(3)zookeeper(1)公众号爬虫(50)爬虫(1)三十而已(1)每日一冷(26)冷兔(12)JDK8新特性(1)lambda详细解析(1)九一八79周年纪念(1)fc(1)jsnes(1)在线玩fc游戏(1)没有比大人更大的人(1)感动(1)生活不易(1)GBA模拟器(1)标签云(1)源码分享(3)动态头像(1)固定url动态图片(1)docker安装mysql(2)navicat链接1251(1)Minio(1)docker安装Minio(1)扫码发短信(1)发短信html(1)网站建设(1)微信刷步(1)wordpress(1)docker安装wordpress(1)酷玩工具(2)Honeyview(1)蜂蜜浏览器(1)SumatraPDF(1)装机工具(1)学习资料(1)小游戏(1)mysql(4)linux安装mysql(1)前端模板(1)dock(1)PowerDesigner(1)破解汉化(1)SpringBoot启动流程(1)SpringBoot自动装载(1)sitemap(1)seo(1)趣味代码(1)fc游戏机(1)小霸王游戏机(1)朋友圈的空调(1)nginx配置黑名单(1)博客嵌入B站视频(1)jQueryTOC(1)Redis面试题(0)Redis(0)吊打面试官(1)mysql8忽略大小写(1)在线玩魔方(1)代码分享(1)Springboot部署windows(1)端口占用(1)QQxml卡片消息发送教程(1)QNotified(1)太极(1)QQ卡片代码(1)九一八(1)远程打卡(1)虚拟定位(1)日记(1)rocketmq(1)消息队列(1)fastdfs(1)office(1)小技巧(1)音乐(1)抖音视频解析(1)无水印下载抖音视频(1)轻量网盘(1)临时邮箱(1)验证码代收(1)Spacedesk(1)Typora(1)视频下载(2)灌篮高手(1)视频流下载(2)散列值(1)数字签名(1)HASH(1)迪迦奥特曼(1)zhihu(2)小说(1)代码优化(1)刷机(1)知乎(1)纪实(1)openssl(1)工作笔记(1)小巷人家(1)视频(1)社保(1)时政(1)AI(1)回表(1)索引覆盖(1)八股文(1)SpringCloud(1)B站(0)AIMV(0)B站(0)AIMV(0)B站(0)AIMV(0)B站(0)AIMV(0)B站(1)AIMV(1)Redis面试题(0)Redis(0)吊打面试官(0)面试(0)Redis面试题(1)Redis(1)吊打面试官(1)面试(1)


