-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Docker Container Won't Start #42
Comments
Do not specify a command for starting manually, the Dockerfile has a CMD entry. That's enough, even for Portainer - I just tested it. Just set the env variables and you're good to go. Also, the command provided by you is missing some quotation marks. |
The command I quoted is what's in the CMD entry as displayed in Portainer's "Container Details" section. Under "Duplicate/Edit" it shows CMD as:
The only change I made to the default configuration is to specify a macvlan as the network otherwise the configuration is as the original container. |
Again, it worked for me. If you insist to a) do it this way and not, let's say, docker-compose and b) it's still not working I'll need step-by-step instructions to reproduce :) |
Here's what I did ...
Is the problem caused by using an IP address for SERVER_HOST rather than a host name? |
Thank you. I could reproduce the error now - after editing the existing container created by Portainer, it seems to change the command for some reason, possibly messing up the quotes?! Either way, please try this:
The Portainer UI now shows this command in my case on the container overview page, which is wrong again (missing some quotes):
and when I edit the container, this (even more wrong):
It seems like I would have to repeat this step (update the command) every time I make some edits to the container, which is annoying (and possibly a bug in Portainer). Anyway, please try if this works for you! |
Yes! It now works fine. As a workaround I might try to put the command in an Env variable then use the variable in the CMD. Thanks for the quick response. And congratulations on creating a terrific application. |
I'm trying to run Owntracks Frontend (owntracks/frontend:latest) in a Docker container via Portainer and the command to start it is:
/bin/sh -c /bin/sh -c " envsubst \${SERVER_HOST} \${SERVER_PORT} \${LISTEN_PORT} < /etc/nginx/nginx.tmpl > /etc/nginx/nginx.conf && nginx -g daemon off; || ( env; cat /etc/nginx/nginx.conf ) "
The environment vars are:
Unfortunately, the container starts and stops immediately reporting:
\${SERVER_PORT}: line 1: syntax error: unterminated quoted string
I've poked around trying to fix this for way too long. What am I missing?
The text was updated successfully, but these errors were encountered: