Git Product home page Git Product logo

Comments (23)

zoryamba avatar zoryamba commented on July 29, 2024 297

used
ENTRYPOINT ["sh", "/docker-entrypoint.sh"]
works for sure without using chmod

from docker.

herloct avatar herloct commented on July 29, 2024 95

I just inserted the chmod + x /docker-entrypoint.sh command in my Dockerfile, but the problem continues.

The file status on host (including permission):
-rw-rw-r--. 1 maycon maycon 1078 Jan 17 21:14 docker-entrypoint.sh

You should make your host's docker-entrypoint.sh executable, not on your Dockerfile.

from docker.

alcohol avatar alcohol commented on July 29, 2024 49

@herloct is correct. Permissions applied through the Dockerfile might not always apply properly (iirc). You should make sure the file has the executable bit set on your host.

from docker.

alcohol avatar alcohol commented on July 29, 2024 42

The rationale behind this, is that I did not invent Docker, and as such, I do not know the intricate inner workings of their tooling. You are looking in the wrong place for answers to your question. This repo is for the Composer image and related Dockerfile, not for questions about how or why certain things in Docker work the way they do.

from docker.

brunowego avatar brunowego commented on July 29, 2024 22

After run chmod +x entrypoint.sh on my host machine, works. Thanks @herloct.

from docker.

JoseFMP avatar JoseFMP commented on July 29, 2024 10

For me none of the solutions mentioned worked. Furthermore, I do not have in my host a docker-entrypoint.sh file. Are you sure this is not in the container?

from docker.

kbirger avatar kbirger commented on July 29, 2024 5

What is the rationale behind this? I can't control the file system on the machine where my docker image may be built. If I'm building an enterprise application, the machine building the image might be a build server VM. It seems kind of crazy to have to package a pre-build step to change permissions on the file before running docker build

from docker.

maitrungduc1410 avatar maitrungduc1410 commented on July 29, 2024 5

The solution of @zoryamba works like a charm! 👍

from docker.

sam-mit avatar sam-mit commented on July 29, 2024 3

Try exposing volume with :z option in the end.

volumes:
    - host_folder:docker_folder:z

from docker.

rafalstepien avatar rafalstepien commented on July 29, 2024 3

Exact same issue as @JoseFMP and @sajcics

from docker.

ildarius avatar ildarius commented on July 29, 2024 3

Complete reinstall of docker is the only thing that helped

from docker.

sajcics avatar sajcics commented on July 29, 2024 2

I have the same situation as you @JoseFMP. what ever I tried it's showing docker-entrypoint.sh: Permission denied, and also I don't have docker-entrypoint at my host.

UPDATE: I removed docker and docker-compose completely from project, and installed again, everything work fine! What caused my issue, I am not sure....so I don't have this issue any more.

from docker.

alcohol avatar alcohol commented on July 29, 2024

Did you build this image yourself? If so, what umask were you using? Can you show the permissions of the files in your working dir?

from docker.

alcohol avatar alcohol commented on July 29, 2024

I am asking cause I had some issues myself when I was building the image locally, but that was because for some reason (I suspect umask cause I was messing around with that for another project) the permissions were only applied for the owner (none for group or 'other').

rob ~ > docker pull composer
Using default tag: latest
latest: Pulling from library/composer

b7f33cc0b48e: Already exists 
a7d6bcc00046: Already exists 
f3822a33fdb2: Already exists 
49a47789bbdf: Already exists 
b9b85d812300: Already exists 
40930b32d1c2: Already exists 
3cb18ef87fdf: Already exists 
30e3579a0be7: Already exists 
e67e6e017632: Pull complete 
1a5a712a40bc: Pull complete 
5aedcf84ef82: Pull complete 
e3ffe27d034d: Pull complete 
a1c7eab4d2b5: Pull complete 
Digest: sha256:5cd8405d83273030c28d0947b5c9600ee49706e09fe098ddbf7ebb46df0f09b0
Status: Downloaded newer image for composer:latest

rob ~ > docker run -it composer:latest bash

bash-4.3# ls -la /docker-entrypoint.sh 
-rwxrwxr-x    1 root     root          1079 Jan 10 18:32 /docker-entrypoint.sh

When building locally the above would yield me the following, which would not work:

bash-4.3# ls -la /docker-entrypoint.sh 
-rwx------    1 root     root          1079 Dec 30 12:32 /docker-entrypoint.sh

from docker.

mayconfsbrito avatar mayconfsbrito commented on July 29, 2024

Yes, I'm trying to build the image to learn how it works. But this time I'm trying with your image, because it is ready and testand, and after I will use it directly from dockerhub.

The file status on host (including permission):
-rw-rw-r--. 1 maycon maycon 1078 Jan 17 21:14 docker-entrypoint.sh

The file status in the image (accesing with docker run):
-rwxrwxrwx 1 root root 1078 Jan 17 23:14 docker-entrypoint.sh

I run the chmod 777 command in the docker-entrypoint.sh file but the problem still persist.

I will try with the image direct from dockerhub to verify that.

from docker.

alcohol avatar alcohol commented on July 29, 2024

Very peculiar. Can you include a log of your terminal showing the exact commands you ran and the exact error messages it produced?

from docker.

glensc avatar glensc commented on July 29, 2024

you may want to track/upvote moby/moby#34819

from docker.

MagicJohnJang avatar MagicJohnJang commented on July 29, 2024

You got to chmod the script to proper permission on the host, before you build the image.

from docker.

misoso avatar misoso commented on July 29, 2024

it work for me, thank you @zoryamba

from docker.

ichux avatar ichux commented on July 29, 2024

used
ENTRYPOINT ["sh", "/docker-entrypoint.sh"]
works for sure without using chmod

You saved me a great deal. Thank you so much

from docker.

glensc avatar glensc commented on July 29, 2024

@JoseFMP @sajcics create new bug report, with all details from your system. how you obtained the image, did you built it, what was the build context, etc.

dragging along old and closed issues does not help anyone. it's too confusing to any volunteer even to dig into the problem to explain what even your "me too" means.

from docker.

hadpro24 avatar hadpro24 commented on July 29, 2024

used
ENTRYPOINT ["sh", "/docker-entrypoint.sh"]
works for sure without using chmod

Thanks

from docker.

pvSource avatar pvSource commented on July 29, 2024

Previous tips didn't help me.
My troubles were in host machine user rights.

Solving (Windows 11):
PowerShell (Run as administrator) -> wsl -> sudo docker ...
(Running all docker commands as root user and with --no-cache flag)

from docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.