docker pull centos
Docker run -it --name="centos-test" centos
yum install wget # 报错在后面有处理的方法
https://lnmp.org/ lnmp环境安装
wget http://soft.vpser.net/lnmp/lnmp1.9.tar.gz -cO lnmp1.9.tar.gz && tar zxf lnmp1.9.tar.gz && cd lnmp1.9 && ./install.sh lnmp
把容器变为镜像
docker ps -a 查看容器的id
$ sudo docker commit eafd9111ada6 php5.6-php-server
Docker run --name="web01" -v /www:/home/wwwroot/default -p 8080:80 -dit php5.6-php-server
访问:127.0.0.1:8080
yum 报错问题
Centos8于2021年年底停止了服务,大家再在使用yum源安装时候,出现下面错误“错误:Failed to download metadata for repo ‘AppStream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist”
1、进入yum的repos目录
cd /etc/yum.repos.d/
2、修改所有的CentOS文件内容
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
3、更新yum源为阿里镜像
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all
yum makecache
4、yum安装测试是否可以yum安装
yum install wget
来源:http://yanggz.caigb.cn/1105.html
标签:centos,repos,lnmp,repo,yum,镜像,docker,php5.6
From: https://www.cnblogs.com/shaoyang0123/p/17061828.html