Docker stuck at "/usr/local/bin/docker-entrypoint.sh: Permission denied"

Viewed 8379

Note that there are two different questions in StackOverflow about the same error message but none of them seems related to the same issue I am experiencing: i.e. the fact that they have the same error message does not mean they are asking the same question. By the way none of them has an answer by now.

So I am trying to run a docker container. I issue this command:

docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:8.0

As you can see from the command itself, this is the mysql repository available in docker hub. I tried with multiple tags from 5.2 up to 8.0 and get the same error message:

/bin/bash: /usr/local/bin/docker-entrypoint.sh: Permission denied
Docker version 19.03.8, build afacb8b7f0

OS is Ubuntu Desktop 20.04

What I tried and did not work:

  • I overrode the image and gave permissions to that script issuing RUN chmod +x /usr/local/bin/docker-entrypoint.sh
  • I overrode the image and gave permissions to that script issuing RUN chmod +x /entrypoint.sh
  • I used the parameter --privileges
  • I made user my docker user in Linux has root privileges just to double check this is not the issue.
  • I tried to add the flag --security-opt apparmor=unconfined
  • I tried to add the flag --mount 'type=volume,src=tatata,dst=/var/lib/mysql' with a previously created volume named tatata

I ran other random docker containers and seem to work.

Also I inspected the dockerfile of the image, as well as the script entrypoint.sh itself which are available here: https://github.com/mysql/mysql-docker/tree/mysql-server/8.0

I do not immediately know what's wrong.

Any ideas?

1 Answers

I do not know what was the problem, but I removed docker completely using synaptic, install it again. Now everything is working fine.

Related