【问题标题】:Docker - Couldn't create the mpm-accept mutexDocker - 无法创建 mpm-accept 互斥锁
【发布时间】:2022-08-10 17:36:23
【问题描述】:

我的 Docker 容器不断重启,出现以下错误:

Operation not supported: AH00023: Couldn\'t create the mpm-accept mutex 

(95)Operation not supported: could not create accept mutex

我在网上尝试了一些解决方案,包括platform: linux/amd64switching docker restart 等...

THIS 解决方案对我不起作用。

但是我没有设法编辑httpd.conf 文件,提供了HERE 的解决方案,因为我无法访问docker 映像来执行此操作,因为它不断重新启动。

现在有人如何克服这个错误吗?我在 Mac M1 上。

Dockerfile:

FROM 242425.a.a.eu-central-1.amazonaws.com/app-php:7.4

ARG COMPOSER_TOKEN
ENV COMPOSER_TOKEN=${COMPOSER_TOKEN}
ARG GITHUB_OAUTH_TOKEN
ENV GITHUB_OAUTH_TOKEN=${GITHUB_OAUTH_TOKEN}
ARG ENVIRONMENT=\"\"
ENV ENVIRONMENT=${ENVIRONMENT}

RUN apt-get --yes update && apt-get --yes --no-install-recommends install supervisor

RUN if [ \"${ENVIRONMENT}\" = \"local\" ]; \\
    then pecl install xdebug && docker-php-ext-enable xdebug; \\
    fi

RUN mkdir /root/.composer
RUN if [ \"${ENVIRONMENT}\" != \"local\" ]; \\
    then echo \"${COMPOSER_TOKEN}\" > /root/.composer/auth.json; \\
    fi

# Configure Apache
COPY ./config/aws/apache2/breitling.conf /etc/apache2/sites-enabled

# Move application in the correct folder
COPY . /var/www/html/
COPY ./config/aws/secrets_manager/${ENVIRONMENT}/map.csv /usr/local/etc/secrets-map.csv
COPY ./config/aws/supervisor/messenger-worker.conf /etc/supervisor/conf.d

# Fix permissions
RUN setfacl -dR \\
    -m u:\"www-data\":rwX \\
    -m g:\"www-data\":rwX \\
    -m u:$(whoami):rwX \\
    -m o::rwX \\
    /var/www/html/var

RUN setfacl -R \\
    -m u:\"www-data\":rwX \\
    -m g:\"www-data\":rwX \\
    -m u:$(whoami):rwX \\
    -m o::rwX \\
    /var/www/html/var

RUN rm -rf \\
    /var/www/html/var/cache/prod \\
    /var/www/html/var/cache/test \\
    /var/www/html/var/cache/dev \\
    > /dev/null 2>&1

RUN mkdir -p \\
    /var/www/html/var/cache/prod \\
    /var/www/html/var/cache/test \\
    /var/www/html/var/cache/dev \\
    > /dev/null 2>&1

# Build application
RUN if [ \"${ENVIRONMENT}\" != \"local\" ]; \\
    then /var/www/html/bin/app_build.sh; \\
    fi

# BAWS-392
RUN if [ \"${ENVIRONMENT}\" != \"local\" ]; then rm -rf /root/.composer/cache; fi
RUN if [ \"${ENVIRONMENT}\" != \"local\" ]; then find /var/www/html/vendor -type d -name .git -delete; fi

ENTRYPOINT /var/www/html/bin/entrypoint.aws.sh
  • 在没有看到 Dockerfile 的情况下诊断有点困难,但是您可以尝试将 CMD 更改为 CMD [\"sh\", \"-c\", \"tail -f /dev/null\"] 这应该保持容器运行,以便您能够在终端中访问它。您还可以在使用以下命令创建 Docker 映像时将 \"Mutex posixsem\" 附加到文件中: RUN echo \"Mutex posixsem\" >> /path/to/httpd.conf
  • 感谢重播。你能告诉我如何找到我的 docker httpd.conf 文件的路径吗? @Bets
  • 另外,如果您能解释一下如何执行第一个建议,因为我是 docker 的新手。 @Bets
  • 我认为最好共享 Dockerfile 的内容(如果其中有任何敏感内容,则为精简版本)。根据 Google 的快速搜索,httpd.conf 文件应该位于 /etc/httpd/conf/httpd.conf,因此您可以添加到您的 Dockerfile(在 CMD 行之前): RUN echo \"Mutex posixsem\" > > /etc/httpd/conf/httpd.conf 会修改 Docker 镜像中的文件。对于第一个建议,您可以替换 Dockerfile 中现有的 CMD 行,在这两种情况下,您都需要重新构建 Docker 映像。
  • 如果你尝试 CMD [\"sh\", \"-c\", \"tail -f /dev/null\"] 选项,你可以通过 Docker 桌面 GUI 访问终端中的容器(它应该有通过运行容器的“在终端中打开”按钮)。

标签: docker docker-compose dockerfile mutex


【解决方案1】:

感谢@Bets,通过将以下内容添加到 Dockerfile 中解决了问题:

RUN echo "Mutex posixsem" >> /etc/apache2/apache2.conf

【讨论】:

  • 欢呼!很高兴为您服务!
猜你喜欢
  • 2013-02-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-05-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多