基于容器制作镜像
拉取一个centos镜像
[root@localhost ~]
Using default tag: latest
latest: Pulling from library/centos
a1d0c7532777: Pull complete
Digest: sha256:a27fd8080b517143cbbbab9dfb7c8571c40d67d534bbdee55bd6c473f432b177
Status: Downloaded newer image for centos:latest
docker.io/library/centos:latest
[root@localhost ~]
REPOSITORY TAG IMAGE ID CREATED SIZE
centos latest 5d0da3dc9764 2 months ago 231MB
基于centos镜像生成一个容器
[root@localhost ~]
[root@d46e5d7f7e13 /]
bin dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv sys tmp usr var
[root@d46e5d7f7e13 /]
[root@d46e5d7f7e13 ~]
[root@d46e5d7f7e13 ~]
[root@d46e5d7f7e13 ~]
[root@d46e5d7f7e13 ~]
[root@d46e5d7f7e13 ~]
[root@d46e5d7f7e13 ~]
[root@d46e5d7f7e13 ~]
[root@d46e5d7f7e13 nginx-1.21.3]
--prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \
--with-debug \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_image_filter_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log
[root@d46e5d7f7e13 nginx-1.21.3]
[root@d46e5d7f7e13 ~]
//修改nginx配置文件
vim /usr/local/nginx/conf/nginx.conf
......
45 index index.php index.html index.htm;
......
65 location ~ \.php$ {
66 root /var/www/html;
67 fastcgi_pass 127.0.0.1:9000;
68 fastcgi_index index.php;
69 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
70 include fastcgi_params;
71 }
......
/usr/local/nginx/sbin/nginx -s reload
[root@d46e5d7f7e13 ~]
[root@d46e5d7f7e13 ~]
cat >> start.sh <<EOF
/usr/local/nginx/sbin/nginx
EOF
chmod +x start