1-docker安装
一、设置IP和检查网络的连通性
1、设置IP
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
l[root@localhost network-scripts]# ls
ifcfg-ens33 ifdown-ppp ifup-ib ifup-Team
[root@localhost network-scripts]# vi ifcfg-ens33
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=4112753a-3a96-4d89-847b-8095c7eadbe9
DEVICE=ens33
ONBOOT=yes
IPV6_PRIVACY=no
IPADDR=192.168.93.159
NETMASK=255.255.255.0
GATEWAY=192.168.93.2
DNS1=192.168.93.2
-----------------选项说明------------------------
BOOTPROTO=static 设置为固定IP
DEVICE=ens33 网卡名
ONBOOT=yes 启用
2、重启网络服务
[root@localhost network-scripts]# systemctl network restart
3、查看网络,必须像下面那样,如果只有第一条不可以PING baidu.com (39.156.69.79) 56(84) bytes of data.
[root@localhost ~]# ping baidu.com
PING baidu.com (39.156.69.79) 56(84) bytes of data.
64 bytes from 39.156.69.79 (39.156.69.79): icmp_seq=1 ttl=128 time=24.5 ms
64 bytes from 39.156.69.79 (39.156.69.79): icmp_seq=2 ttl=128 time=25.3 ms
二、安装docker
1、安装工具
[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
2、[root@localhost ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
不成功多试几次,必须出现repo saved to /etc/yum.repos.d/docker-ce.repo
Loaded plugins: fastestmirror, langpacks
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
3、安docker
[root@localhost ~]# yum -y install docker-ce
4、启动
[root@localhost ~]# systemctl start docker
5、设置开机启动
[root@localhost ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
6、设置镜像代理即改下载源要不然下载镜像的时候下载不下来,我用的是阿里云,用其它的也可以。
[root@localhost /]# cd /etc/docker
[root@localhost docker]# vi daemon.json
在里面输入自己的唯一值,登录上阿里云之后,搜索“容器镜像服务”之后点击开通就好。不用去设置别的,每个人生成都是唯一的值
[root@localhost /]# sudo mkdir -p /etc/docker
[root@localhost docker]# vi daemon.json
输入如下内容:
{
"registry-mirrors": ["https://换成自己申请的数字.mirror.aliyuncs.com"]
}
7、重载和重启
[root@localhost docker]# systemctl daemon-reload
[root@localhost docker]# systemctl restart docker
8、查看信息
[root@localhost docker]# docker info
Client:
Debug Mode: false
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 19.03.8
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:
seccomp
Profile: default
Kernel Version: 3.10.0-957.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 972.6MiB
Name: localhost.server1
ID: YNJF:2HH6:WPSH:Y2OS:OIWY:TR6N:OIIP:4A7B:SMLI:SPJR:AUTU:NTM7
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Registry Mirrors:
https://8m6o6e30.mirror.aliyuncs.com/
Live Restore Enabled: false
9、pull镜像成功了
[root@localhost docker]# docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:f9dfddf63636d84ef479d645ab5885156ae030f611a56f3a7ac7f2fdd86d7e4e
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
10、查看
[root@localhost docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest fce289e99eb9 14 months ago 1.84kB
11、运行
[root@localhost docker]# docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
1-docker安装相关推荐
- Docker安装Apache与运行简单的web服务——httpd helloworld
Docker运行简单的web服务--httpd helloworld目录[阅读时间:约5分钟] 一.Docker简介 二.Docker的安装与配置[CentOS环境] 三.Docker运行简单的web ...
- etcd 笔记(02)— etcd 安装(apt 或 yum 安装 、二进制包安装、Docker 安装 etcd、etcd 前端工具etcdkeeper)
1. 使用 apt 或 yum 安装 etcd 命令如下: sudo apt-get install etcd 或者 sudo yum install etcd 这样安装的缺点是:安装的 etcd 版 ...
- docker安装Mysql5.7以及远程登陆链接配置
1.安装mysql5.7 docker镜像 docker安装:docker安装一条龙 1.拉取官方mysql5.7镜像 docker pull mysql:5.7 root@VM-12-5-ubunt ...
- docker 安装oracle_阿里云使用Docker搭建Hadoop集群
摘要 吐血整理,搭建了两遍,亲测可用!!! 我买的是阿里云2C4G的服务器,使用的是CentOS 7.7版本.在搭建过程中踩了不少坑,本篇文章希望对大家有用 CentOS 7.7安装Docker 查看 ...
- docker 安装和使用
目录 1.安装docker的官方网站 配置镜像加速器 查看docker安装的版本 重启docker 启动 docker 查看启动的状态 下载测试镜像 并且启动该容器 2.操作docker 镜像的常用命 ...
- docker 安装 oracle12,使用Docker安装Oracle 12c
使用Docker安装Oracle 12c 假设你的服务器已成功安装Docker,继续进行以下操作: 1. 启动Docker [root@node01 ~]# service docker start ...
- Centos-安装Docker并使用Docker安装mysql遇到的问题以及解决方法
为什么安装Docker?? ----不知道啊,说是用其安装mysql简单 step1: 首先百度,查找安装的教程,哎,找到了: 如下: https://www.jianshu.com/p/9c9 ...
- 002.Docker安装部署
一 docker安装-CentOS系统 1.1 docker自动安装脚本 1 root@docker:~# wget -qO- https://get.docker.com/ | sh 2 或-- 3 ...
- Linux磁盘挂载和docker安装
本篇给大家介绍Linux磁盘挂载和docker安装的相关内容,Linux服务器的操作是一个手熟的过程,一些不常用的命令隔断时间就忘记了,熟话说好记性不如烂笔头,还需在平时的工作中多练习记录. 最近新申 ...
- Docker学习(一)Ubuntu版本的Docker安装和使用
2019独角兽企业重金招聘Python工程师标准>>> Docker安装: [apt-get install docker.io 如果不成功先运行 apt-get update] ...
最新文章
- 全球支付平台paypal社招一面,二面合并面经
- day15-JavaScript字符串操作以及跑马灯示例
- 【Android FFMPEG 开发】Android 中执行 FFMPEG 指令 ( 集成 FFmpegAndroid 框架 )
- RuoYi后台系统权限管理解析
- python 定义数字_Python:已定义数字列表的差异
- webviewjavascriptbridge android ios,js与ios交互使用WebViewJavascriptBridge如何写多个函数
- 这样设置路由,99.9%的黑客都攻不破
- Android 通过StickyBroadcast获取电量
- IDEA 常用快捷键 常用插件 1
- Java后台调用第三方支付接口(易宝支付)
- FFmpeg进阶:给视频添加文字水印
- PHP解决验证码无法显示的方法
- springboot发送qq邮件详细步骤
- html圣杯布局,三种实现圣杯布局方法
- 数据结构:单链表——带头结点与不带头结点步骤详解
- 第14课:Spark 分布式模型训练及调优(实战)
- 华为网络设备综合配置实验
- 银行定期存款利息明细表一览
- Comet OJ CCPC-Wannafly Comet OJ 夏季欢乐赛(2019)
- 检查手机端还是非手机端,做m站和pc站的适配