繁体   English   中英

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

[英]Docker OSX port mapping error when run: exec

如果我运行一个容器(同时尝试了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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM