title: Docker stuck at "/usr/local/bin/docker-entrypoint.sh: Permission denied"
body: <p>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.</p>
  
  <p>So I am trying to run a docker container. I issue this command:</p>
  
  <pre><code>docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:8.0
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>/bin/bash: /usr/local/bin/docker-entrypoint.sh: Permission denied
  </code></pre>
  
  <pre><code>Docker version 19.03.8, build afacb8b7f0
  </code></pre>
  
  <p>OS is Ubuntu Desktop 20.04</p>
  
  <p>What I tried and did not work:</p>
  
  <ul>
  <li>I overrode the image and gave permissions to that script issuing <code>RUN chmod +x /usr/local/bin/docker-entrypoint.sh</code></li>
  <li>I overrode the image and gave permissions to that script issuing <code>RUN chmod +x /entrypoint.sh</code></li>
  <li>I used the parameter <code>--privileges</code></li>
  <li>I made user my <code>docker</code> user in Linux has root privileges just to double check this is not the issue.</li>
  <li>I tried to add the flag <code>--security-opt apparmor=unconfined</code></li>
  <li>I tried to add the flag <code>--mount 'type=volume,src=tatata,dst=/var/lib/mysql'</code> with a previously created volume named <code>tatata</code></li>
  </ul>
  
  <p>I ran other random docker containers and seem to work.</p>
  
  <p>Also I inspected the dockerfile of the image, as well as the script <code>entrypoint.sh</code> itself which are available here: <a href="https://github.com/mysql/mysql-docker/tree/mysql-server/8.0" rel="nofollow noreferrer">https://github.com/mysql/mysql-docker/tree/mysql-server/8.0</a></p>
  
  <p>I do not immediately know what's wrong.</p>
  
  <p>Any ideas?</p>