docker入门一:docker安装(在线跟离线)
2024-08-22 12:38:57
一.在线安装
1.安装依赖
yum install -y yum-utils device-mapper-persistent-data lvm2
2.添加软件源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3.安装docker-ce
yum -y install docker-ce
4.启动服务
systemctl start docker
5.查看docker版本信息
docker version
二.离线安装
1.登录镜像网站
https://download.docker.com/linux/static/stable/x86_64/
2.解压
tar -xvf docker-18.06.-ce.tgz
3.把解压出来的文件移动到/usr/bin 目录下
cp docker/* /usr/bin/
4.将docker注册为service
vim /etc/systemd/system/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
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 and above support this version.
#TasksMax=infinity
TimeoutStartSec=
# 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=
StartLimitInterval=60s [Install]
WantedBy=multi-user.target
5.启动
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload
systemctl start docker
systemctl enable docker.service
原文:https://blog.csdn.net/ywd1992/article/details/82897394
6.安装好的docker没有补全,从其他服务器拷贝一份docker
ll /usr/share/bash-completion/completions/docker
7.将docker文件放置相同路径下,并生效
source /usr/share/bash-completion/completions/docker
最新文章
- 前端MVVM框架设计及实现
- .NET使用OpenSSL生成的pem密钥文件[1024位]
- Linux 基础命令-CURL 表单上传文件
- Java连接Oracle
- [转]IIS部署托管管道模式的集成和经典区别
- 怎么制作生成苹果手机app应用的下载二维码图片
- ACM_2057
- 企业证书发布APP
- 响应式布局—设备像素密度测试 (-webkit-min-device-pixel-ratio)
- Codeforces 840D Expected diameter of a tree 分块思想
- 在vue中使用vuex 一个简单的实例
- Vue:模板&;渲染函数学习
- maven项目报错--Cannot change version of project facet Dynamic Web Module to 3.0 Error in Eclipse
- OpenStack 计算服务 Nova计算节点部署 (九)
- SpringMVC一些功能
- google,百度地图POI下载
- 算法之去掉vetor集合中的重复元素
- NOIP2018酱油记
- 轻量级自动化工具 pssh
- @b.windows.last.use
热门文章
- Android : Camera HAL3的参数传递(CameraMetadata)
- 安卓之Android.mk多文件以及动态库编译
- ThinkPHP5最新URL访问:PATH_INFO和兼容模式
- EasyNVR摄像机网页直播之问题解决:Failed:SYSTEM\CurrentCont......\Application\EasyNVR_Service registry key already
- js和jquery通过this获取html标签中的属性值[转藏]
- Jenkins - 以Docker方式安装启动Jenkins
- torch7安装的坑
- PAT(B) 1055 集体照(Java)
- 【Linux】一步一步学Linux——Linux系统目录详解(09)
- 【SQL Server数据迁移】64位的机器:SQL Server中查询ORACLE的数据