简体   繁体   English

使用端口 80 部署标准容器时,IBM Cloud Code Engine 修订失败

[英]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.

相关问题 IBM Cloud Code Engine:本地构建的容器镜像在部署时出现 exec 格式错误 - IBM Cloud Code Engine: Locally built container image gives exec format error when deployed IBM Cloud Code Engine 无法为私有存储库构建 - IBM Cloud Code Engine fails to build for private repo IBM Cloud Code Engine:当应用程序不活动时如何检查日志? - IBM Cloud Code Engine: How to check logs when app not active? 在 IBM Cloud Kubernetes 中公开 HAProxy(端口 80)Docker 的最简单方法 - Simplest approach to expose a HAProxy (port 80) Docker in IBM Cloud Kubernetes IBM Cloud:如何控制由 Code Engine 构建引起的容器镜像数量? - IBM Cloud: How to control number of container images caused by Code Engine builds? IBM Cloud Code Engine:构建在步骤“step-build-and-push”中失败,错误为 UNAUTHORIZED - IBM Cloud Code Engine: Build fails in step “step-build-and-push” with error UNAUTHORIZED IBM Cloud:如何打开分析引擎端口 7070? - IBM Cloud: How to open Analytics Engine port 7070? IBM Cloud Code Engine:流量拆分时应用程序修订的不同响应时间 - IBM Cloud Code Engine: Different response times for app revisions when traffic is split 部署到IBM Cloud的问题 - Problems deploying to IBM Cloud 使用 Cloud Engine 时,在 IBM Cloud 中可访问作业的输出在哪里? - Where is the ouput of a Job accessible in IBM Cloud, when using Cloud Engine?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM