Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy overrides entrypoint.sh #43

Closed
pisarik opened this issue Nov 12, 2021 · 5 comments
Closed

Copy overrides entrypoint.sh #43

pisarik opened this issue Nov 12, 2021 · 5 comments

Comments

@pisarik
Copy link

pisarik commented Nov 12, 2021

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 . .

@pisarik
Copy link
Author

pisarik commented Nov 12, 2021

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

@maxiller
Copy link

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
Copy link

maxiller commented May 12, 2022

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.

@mod64bits
Copy link

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

@SaraFarron
Copy link

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

@mjhea0 mjhea0 closed this as completed Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants