[英]IBM Cloud Code Engine revision fails when deploying standard container with port 80
I am trying to deploy an app in a Code Engine project .我正在尝试在代码引擎项目中部署应用程序。 The container image is pretty standard: docker.io/library/httpd .
容器镜像非常标准: docker.io/library/httpd 。 All I did in the configuration wizard is to change the port from Code Engine default 8080 to port 80.
我在配置向导中所做的只是将端口从 Code Engine 默认的 8080 更改为端口 80。
Code Engine comes back with:代码引擎回来了:
Revision failed to start with "exit code 1".
修订未能以“退出代码 1”开始。 Check your image and configuration.
检查您的图像和配置。
In the logs I found these two lines:在日志中我发现了这两行:
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
Why?为什么?
I don't know the answer to your question "why", except I see some people on Stackoverflow mention the range up to 1024 is reserved by the OS.我不知道你的问题“为什么”的答案,除了我看到 Stackoverflow 上的一些人提到操作系统保留了高达 1024 的范围。 I could run my httpd locally on port 80, but in the IBM Code Engine I had to change to 8080.
我可以在本地端口 80 上运行我的 httpd,但在 IBM Code Engine 中我必须更改为 8080。
This is how I managed to get it running:这就是我设法让它运行的方式:
I edited the httpd.conf as this post implies:正如这篇文章所暗示的那样,我编辑了 httpd.conf:
"There is a hint on how to do this at the DockerHub page. An alternative config file must be obtained and added to the container via the Dockerfile. “在 DockerHub 页面上有关于如何执行此操作的提示。必须通过 Dockerfile 获取替代配置文件并将其添加到容器中。
First get a copy of the config file:首先获取配置文件的副本:
docker run --rm httpd:2.4 cat /usr/local/apache2/conf/httpd.conf > my-httpd.conf
Then edit the my-httpd.conf file and modify the port:然后编辑 my-httpd.conf 文件并修改端口:
Listen 8080
Finally add to the Dockerfile the instruction to copy it:最后在 Dockerfile 中添加复制指令:
COPY./my-httpd.conf /usr/local/apache2/conf/httpd.conf
" COPY./my-httpd.conf /usr/local/apache2/conf/httpd.conf
"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.