django-on-docker icon indicating copy to clipboard operation
django-on-docker copied to clipboard

Copy overrides entrypoint.sh

Open pisarik opened this issue 4 years ago • 4 comments

This will override entrypoint.sh, isn't it?

https://github.com/testdrivenio/django-on-docker/blob/ce7c04cc14c95fa29799e2d40d6bdbdb5554f7c4/app/Dockerfile#L20-L26

pisarik avatar Nov 12 '21 00:11 pisarik

Looks that COPY . . is unnecessary at all, since the folder will be mounted anyway (i.e. volumes option in compose config)

pisarik avatar Nov 12 '21 01:11 pisarik

well, this does not work with bind mounts no matter what I tried. App container just does not go up. Switching to named volume works, but is not quite what's expected, since every app code change would mean volume rebuild.

Struggling with this error:

Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/usr/src/app/entrypoint.sh": stat /usr/src/app/entrypoint.sh: no such file or directory: unknown

MacOS, docker runs on lima.

maxiller avatar May 10 '22 15:05 maxiller

Well, it seems lima is causing this behaviour, eventually... The daemon inside it executes instructions from compose file that order mounting a path, it executes it, but that path obviously does not exist in the lima's vm. Going to try out some other alternative to docker desktop.

UPD: replaced the runtime with colima, and now it works fine.

maxiller avatar May 12 '22 14:05 maxiller

I'm having a permission error on entrypoint.prod.sh container process: exec: "/home/app/web/entrypoint.prod.sh": permission denied: unknown

mod64bits avatar May 19 '22 03:05 mod64bits

For those who get permission denied: unknown change entrypoint.sh or entrypoint.prod.sh like

# copy entrypoint.sh
# COPY ./entrypoint.sh .

# copy project
COPY . .
RUN sed -i 's/\r$//g' /usr/src/app/entrypoint.sh
RUN chmod +x /usr/src/app/entrypoint.sh

so that file is copied and then permissions applied

SaraFarron avatar Jul 06 '23 06:07 SaraFarron