testdrivenio/django-on-docker

Copy overrides entrypoint.sh

pisarik opened this issue · 6 comments

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

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

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

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.

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.

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

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