building a Nginx application from Git using S2I
此示例显示了如何构建:
来自Red Hat Container Registry中可用的registry.redhat.io/rhel8/nginx-116:latest构建器的新容器镜像,以及一个测试应用程序,可从gitee nginx-container存储库中的公共Git存储库中的1.16/test/test-app/目录中获得。
安装S2I tool
Install the S2I tool from the Red Hat Software Collections repository
下载 builder image镜像
docker pull registry.redhat.io/rhel8/nginx-116
利用nginx从gitee的源码创建nginx应用
这个有几个包还是github上的,需要耐心等待下
s2i build https://gitee.com/null_454_5218/nginx-container.git --context-dir=1.16/test/test-app/ registry.redhat.io/rhel8/nginx-116:latest nginx-sample-app
构建新的应用镜像是:nginx-sample-app
nginx-sample-app latest 75ac912f2b83 6 minutes ago 411
运行新的应用镜像
docker run -p 8080:8080 nginx-sample-app
验证新的应用
curl -k http://localhost:8080