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

/entrypoint.d/ folder is not read by partent container's entrypoint.sh script #21

Closed
JonasAlfredsson opened this issue Mar 15, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@JonasAlfredsson
Copy link
Owner

JonasAlfredsson commented Mar 15, 2021

It looks like the offending line is the following:

if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
    ...
fi

And since we are starting this container with "/bin/bash /scripts/start_nginx_certbot.sh" this is never triggered.
I will see how this is easiest fixed.

@JonasAlfredsson JonasAlfredsson added the bug Something isn't working label Mar 15, 2021
@JonasAlfredsson
Copy link
Owner Author

Embarrassing that I had not noticed this before, but a solution might be to change that line to something like this:

if echo "$1" | grep -q "nginx"; then

Then we change our start command to only "/scripts/start_nginx_certbot.sh", and thus we will cover all the possible cases.

@JonasAlfredsson
Copy link
Owner Author

This is perhaps best to include already in the Dockerfile, where we replace this line with a nice sed command that will fail in case the parent container change their script too much.

Inspiration: https://stackoverflow.com/a/15966279

@JonasAlfredsson
Copy link
Owner Author

Not the most readable sed command I have written, but this one seems to solve the issue: ba8a9c5

@JonasAlfredsson JonasAlfredsson self-assigned this Mar 15, 2021
JonasAlfredsson added a commit to JonasAlfredsson/isomer-redirection that referenced this issue Mar 15, 2021
The latest version of the container contains this fix: [Startup scripts are not triggered](JonasAlfredsson/docker-nginx-certbot#21)
From what I gathered you needed a [short sleep](https://github.com/isomerpages/isomer-redirection/blob/staging/00-sleeper.sh) or else AWS would kill the container? 
However, a super obvious bug from my side made so that this script would never be triggered. This is now fixed, but you were able to run this either way?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant