身高差效果图网站,北京住房和建设部网站,品牌营销的定义,seo wordpress1.下载基础镜像
上一次#xff0c;我们通过正向互联网代理在内网环境中#xff0c;搭建了一个docker环境#xff0c;具体环境如下#xff1a;
1) 内网docker服务器#xff1a;192.168.123.1#xff0c;操作系统为#xff1a;redhat 7.9
2) 代理服务器(可通外网)#…1.下载基础镜像
上一次我们通过正向互联网代理在内网环境中搭建了一个docker环境具体环境如下
1) 内网docker服务器192.168.123.1操作系统为redhat 7.9
2) 代理服务器(可通外网)192.168.110.2操作系统为redhat 7.9我们在docker服务器上下载镜像进行测试
docker pull centos2.运行容器
docker run -itd -p 8080:80 --name wxtest_container --privileged centos /sbin/init注这里使用–privileged和/sbin/init参数启动容器主要是为了方便在容器中安装软件并通过systemctl命令启动软件服务
3.登陆容器
通过docker exec登陆容器
docker exec -it wxtest_container /bin/bash4.测试是否可以通外网
curl https://www.baidu.com/发现无法通外网
5.更改配置让容器登陆外网
vi /etc/profile
export http_proxyhttp://192.168.110.2:9099
export https_proxyhttp://192.168.110.2:9099
export no_proxylocalhost,127.0.0.1source /etc/profile6.测试是否可以通外网
curl https://www.baidu.com/7.配置yum源
由于在docker下没有安装wget工具因此可以使用curl下载镜像源
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo8.安装Apache http服务
yum install -y httpd9.创建默认的访问界面index.html启动httpd服务
echo HelloDocker /var/www/html/index.htmlsystemctl start httpd
systemctl enable httpd10.制作镜像
在docker服务器上制作镜像
docker commit wx_tests_container Self_httpd