错误:启动容器进程导致“ exec://docker-entrypoint.sh\”:权限被拒绝“ [英] Error: Starting container process caused "exec: \"/docker-entrypoint.sh\": permission denied"

查看:3222
本文介绍了错误:启动容器进程导致“ exec://docker-entrypoint.sh\”:权限被拒绝“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建docker-compose,但出现此错误:

I'm trying to build docker-compose, but I'm getting this error:


ERROR:fordicaaquicombrold_mysqld_1无法启动服务mysqld:
oci运行时错误:container_linux.go:247:启动容器进程
导致 exec:\ /docker-entrypoint.sh\:权限被拒绝

ERROR: for indicaaquicombrold_mysqld_1 Cannot start service mysqld: oci runtime error: container_linux.go:247: starting container process caused "exec: \"/docker-entrypoint.sh\": permission denied"

错误:针对mysqld无法启动服务mysqld:oci运行时错误:
container_linux.go:247:启动容器进程引起 exec:
\ / docker-entrypoint。 sh\:权限被拒绝

ERROR: for mysqld Cannot start service mysqld: oci runtime error: container_linux.go:247: starting container process caused "exec: \"/docker-entrypoint.sh\": permission denied"

错误:启动项目时遇到错误。

ERROR: Encountered errors while bringing up the project.

docker-compose.yml

docker-compose.yml

version: '3'

services:
  php:
    build:
      context: ./docker/php
    image: indicaaqui.com.br:tag
    volumes:
      - ./src:/var/www/html/
      - ./config/apache-config.conf:/etc/apache2/sites-enabled/000-default.conf
    ports:
      - "80:80"
      - "443:443"

  mysqld: 
    build:
      context: ./docker/mysql
    environment:
      - MYSQL_DATABASE=db_indicaaqui
      - MYSQL_USER=indicaqui
      - MYSQL_PASSWORD=secret
      - MYSQL_ROOT_PASSWORD=docker      
    volumes:
      - ./config/docker-entrypoint.sh:/docker-entrypoint.sh
      - ./database/db_indicaaqui.sql:/docker-entrypoint-initdb.d/db_indicaaqui.sql

Dockerfile(php)

Dockerfile (php)

FROM php:5.6-apache

MAINTAINER Limup <limup@outlook.com>

CMD [ "php" ]

RUN docker-php-ext-install pdo_mysql

# Enable apache mods.
# RUN a2enmod php5.6
RUN a2enmod rewrite


# Expose apache. 
EXPOSE 80
EXPOSE 443

# Use the default production configuration
# RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

# Override with custom opcache settings
# COPY ./../../config/php.ini $PHP_INI_DIR/conf.d/

# 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

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

RUN a2dissite 000-default.conf 
RUN chmod -R 777 /etc/apache2/sites-enabled/

WORKDIR /var/www/html/

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

Dockerfile(Mysql)

Dockerfile (Mysql)

FROM mariadb:latest

RUN chmod -R 777 /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]

EXPOSE 3306
CMD ["mysqld"]

请帮我解决这个问题!

有什么想法吗?

Please, help me solve this problem!
Any ideas?

推荐答案

这很可能是 config / docker-entrypoint.sh 上的Linux文件权限问题。如果您的主机是Linux / Mac,则可以运行:

That is most likely a Linux file permission issue on config/docker-entrypoint.sh. If your host is Linux/Mac, you can run:

chmod 755 config/docker-entrypoint.sh

有关Linux权限的更多信息,这是一篇有用的文章: https://www.linux.com/learn/understanding-linux-file-permissions

For more on linux permissions, here's a helpful article: https://www.linux.com/learn/understanding-linux-file-permissions

这篇关于错误:启动容器进程导致“ exec://docker-entrypoint.sh\”:权限被拒绝“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆