Error: Starting container process caused "exec: \"/docker-entrypoint.sh\": permission denied"

Limup

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

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"

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

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)

FROM php:5.6-apache

MAINTAINER Limup <[email protected]>

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)

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?

BMitch

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

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

Collected from the Internet

Please contact javaer1[email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

docker run results in starting container process caused "exec: \"./boot.sh\": permission denied

Running a docker Image of Golang failed, with error 'starting container process caused: exec: "/path": permission denied'

Starting container process caused "exec: \"/tmp/run.sh\": permission denied": unknown

starting container process caused "exec: \"/tmp/installer.sh\": permission denied"

starting container process caused "exec: \"/app\": permission denied": unknown

Permission denied docker-entrypoint.sh

How to fix 'Permission denied' in Docker sh entrypoint

Error running docker container: starting container process caused "exec: \"python\": executable file not found in $PATH": unknown

Docker-compose "exec: \"/usr/src/app/entrypoint.sh\": permission denied"

Starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown

starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory":

podman MongoDB docker-entrypoint.sh permission denied

Docker not starting, volume permission denied error

starting container process caused: exec: "/bin/sh": stat /bin/sh: no such file or directory ---- executor failed running [/bin/sh -c

Jenkinsfile: permission denied when running sh step in Docker container

Docker "permission denied" in container

Docker Go image: starting container process caused: exec: "app": executable file not found in $PATH: unknown

Getting error "/usr/local/bin/docker-entrypoint.sh: 16: exec: redis-server --port 6000: not found" inside docker container

Docker-compose doesn't work on ubuntu 20.04 [permission denied entrypoint.sh]

/bin/sh: /root/start-docker.sh: Permission denied when exec command in docker

dotnet restore error inside Docker-Container - permission denied

Permission denied error when pinging inside Docker container

Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "python":

Permission denied inside Docker container

Permission denied on one docker container

Docker and php "standard_init_linux.go:207: exec user process caused "exec format error". Also entrypoint fails to read parameters for exec

Rancher - standard_init_linux.go:190: exec user process caused "permission denied"

docker buildx "exec user process caused: exec format error"

===== docker migrate release ===== [FATAL tini (8)] exec /app/migrate.sh failed: Permission denied