gpt4 book ai didi

macos - 运行时Docker OSX端口映射错误:exec

转载 作者:行者123 更新时间:2023-12-02 20:49:58 24 4
gpt4 key购买 nike

如果我运行一个容器(尝试使用ubuntu和debian),它在后台运行良好,但是当我尝试执行docker run name -p 80:8080时,出现以下错误:

docker: Error response from daemon: invalid header field value 

“oci运行时错误:container_linux.go:247:正在启动容器进程
引起\“exec:\\”-p \\“:在$ PATH \” \ n“中找不到可执行文件。

这是我的dockerfile:
FROM ubuntu:latest
MAINTAINER Phil Palmieri

# Install apache, PHP, and supplimentary programs. openssh-server, curl, and lynx-cur are for debugging the container.
RUN apt-get update && apt-get -y upgrade && DEBIAN_FRONTEND=noninteractive apt-get -y install \
apache2 php7.0 php7.0-mysql libapache2-mod-php7.0 curl lynx-cur

# Enable apache mods.
RUN a2enmod php7.0
RUN a2enmod rewrite

# Update the PHP.ini file, enable <? ?> tags and quieten logging.
RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.0/apache2/php.ini

# Manually set up the apache environment variables
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid

# Expose apache.
EXPOSE 80

# Copy this repo into place.
ADD . /var/www/site

# Mount the volume for dev
VOLUME [".:/var/www/site"]

# Update the default apache site with the config we created.
ADD apache-config.conf /etc/apache2/sites-enabled/000-default.conf

# By default start up apache in the foreground, override with /bin/bash for interative.
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]

最佳答案

在您的情况下,正确的docker run如下所示:
docker run -i -d -p 80:8080 abbvie/wow17:1.0

关于macos - 运行时Docker OSX端口映射错误:exec,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40679714/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com