惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

Rat's Blog - Docker

使用Searx搭建一个私人的搜索引擎平台,可展现Google/Bing等70多种搜索网站的搜索结果 - Rat's Blog 使用Docker快速安装Poste.io邮件服务器 - Rat's Blog 使用Docker安装Seafile云盘专业版,并配置域名及SSL证书 - Rat's Blog 使用Docker快速安装rTorrent和ruTorrent - Rat's Blog VPS使用GDList挂载Google Drive和OneDrive网盘,支持多个同时挂载 - Rat's Blog 使用Docker快速安装H5ai网盘、内置HTML5视频播放器DPlayer - Rat's Blog Linux VPS使用Docker快速安装Cloudreve多功能网盘 - Rat's Blog 使用Docker快速安装Aria2+AriaNg+h5ai,可离线BT下载和在线播放 - Rat's Blog 使用Docker快速安装FileRun多功能网盘 - Rat's Blog
Linux VPS使用Docker快速部署一个CentOS系统容器 - Rat's Blog
博主: Rat's · 2018-05-23 · via Rat's Blog - Docker

说明:我们很多都需要新系统来测试一些东西,如果没多的VPS服务器的话,就很蛋疼了。这时候我们可以在仅有的服务器上使用Docker部署一个新系统来供我们测试,测试完再直接清空容器,而不会影响到服务器本身,很方便。话说好像可以用这个方法在一个VPS上部署很多个类似NAT小鸡?只是与真NAT不同的是资源全部共享,一般玩玩还是可以的。这里就分享个由ilemonrain博主制作的CentOS镜像。

镜像

1、镜像说明
此镜像基于CentOS官方镜像制作而成,集成OpenSSH-ServerOpenSSH-Clientinitscripts(可以使用service命令)、EPEL镜像源、wgetpasswdtarunzip,满足最低运行环境需求,如果其他需要,请自行使用yum install进行安装。

受制于systendDocker上的兼容性,CentOS 7.x系统将无法使用systemd相关程序 (如systemctlservice等),如果后台启动服务的需要,请使用CentOS 6.x镜像,(默认拉取的镜像为CentOS 6.9)。

推荐使用最新的镜像(CentOS 6.9CentOS 7.4),受制于Docker本身机制,无法在yum update升级系统版本后reboot(重启)完成升级。所以除非特殊需要,否则建议你使用最新镜像,避免很多问题。

2、镜像标签

CentOS 7.4.1708 (7.4, 7.4.1708, 7)
CentOS 7.3.1611 (7.3, 7.3.1611)
CentOS 7.2.1511 (7.2, 7.2.1511)
CentOS 7.1.1503 (7.1, 7.1.1503)
CentOS 7.0.1406 (7.0, 7.0.1406)
CentOS 6.9 (6.9, 6, latest)
CentOS 6.8 (6.8)
CentOS 6.7 (6.7)
CentOS 6.6 (6.6)

安装

1、安装Docker

#CentOS 6
rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum update -y
yum -y install docker-io
service docker start
chkconfig docker on

#CentOS 7、Debian、Ubuntu
curl -sSL https://get.docker.com/ | sh
systemctl start docker
systemctl enable docker

2、拉取CentOS镜像
启动命令:

docker run -d -p 2222:22 --name CentOS-Docker ilemonrain/centos-sshd 

参数说明:

-d:以Daemon(后台)模式启动镜像
-p 2222:22:暴露宿主机的2222端口,映射到容器内部的22端口 (SSH)
--name CentOS-Docker:容器名称
ilemonrain/centos-sshd:镜像名称

请按照自己的实际需要,暴露对应的端口。

更多说明:

#如果需要暴露更多的内部端口,可以使用多个-p参数,比如-p 80:80 -p 53:53。如果需要区分协议,请在-p参数后面注明,比如-p 80:80/tcp -p 53:53/udp。

#ilemonrain/centos-sshd镜像默认为CentOS 6.9系统,如果你要安装CentOS 7.4,后面参数则为ilemonrain/centos-sshd:7.4,其它系统以此为参考。

#如果想部署多个CentOS系统容器,则注意将容器名称改成不同的即可!

部署好了后,SSH登录信息:

用户名:root
密码:centos

请在成功登录SSH后,立即修改你的SSH密码,以防止被恶意爆破。


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/635/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。