Comments (6)
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.
from frontend.
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:
'/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 only change I made to the default configuration is to specify a macvlan as the network otherwise the configuration is as the original container.
from frontend.
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 :)
from frontend.
Here's what I did ...
- Portainer > Create Container
- Image: owntracks/frontend:latest
- Changed Network to my macvlan
- Set IPv4 address to 192.168.3.100
- Set Primary DNS to 192.168.2.112 (that's a Pi-Hole container)
- Set Secondary DNS to 8.8.8.8
- Set Env > SERVER_HOST to 192.168.2.103 (that's a Mosquitto container)
- Deployed successfully then the container immediately stops
- Log shows
\${SERVER_PORT}: line 1: syntax error: unterminated quoted string
Is the problem caused by using an IP address for SERVER_HOST rather than a host name?
from frontend.
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:
-
Click on "Duplicate/Edit"
-
Replace the command (now with a lot more quotes than necessary
👀 ) with this:/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 )"
-
When asked to replace the container, confirm
-
In my case it was running again afterwards, could be stopped and started again
The Portainer UI now shows this command in my case on the container overview page, which is wrong again (missing some quotes):
/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 )
and when I edit the container, this (even more wrong):
'/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 ) '
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!
from frontend.
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.
from frontend.
Related Issues (20)
- URL-Encode is hindering HOT 1
- Improvement: Selection of Settings HOT 1
- Change default time span thats loaded HOT 3
- Date/time filtering is not working HOT 2
- OSM Map not loading with reverse proxy HOT 4
- Document changing of application path HOT 1
- No line segment drawn on position update HOT 2
- config.js fails with 500 when running owntracks/frontend:latest HOT 5
- GeoJson Download HOT 3
- Wrong order when connecting points with line (frontend does not respect timestamps correctly) HOT 3
- Container just constantly restarts HOT 4
- Can't find servers name HOT 1
- Noob Guide HOT 4
- Websockets and openstreetmaps HOT 1
- Mapbox changed its api
- Dynamic filter minAccuracy
- Frontend stopped connecting to recorder. HOT 10
- Doesn't load map element HOT 5
- Include precompiled dist/ in releases HOT 4
- Frontend doesn't show any points HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frontend.