Comments (10)
Oh, it is just easier for me to test different things.
ENTRYPOINT starts the container with parameters that cannot be overridden with CLI parameters.
CMD allows to do so.
In other words, when you specify:
ENTRYPOINT=/usr/bin/my-script.sh
then you cannot start your container with different parameter/script for example:
docker run -it my-docker-image /usr/bin/different-script.sh
The above example will start your container with /usr/bin/my-script.sh
regardless what you specify as a starting parameter. In fact /usr/bin/different-script.sh
will be interpreted as a parameter for your entrypoint.
When you use
CMD=["/usr/bin/my-script.sh"]
instead, you can override the starting point, so the above command will start your container with /usr/bin/different-script.sh
.
When you specify both ENTRYPOINT and CMD, then whatever you put into the CMD becomes a parameter for your entrypoint. For example:
ENTRYPOINT=/usr/bin/my-script.sh
CMD=["parameter1", "parameter2"]
will be interpreted as:
/usr/bin/my-script.sh parameter1 parameter2
and you can override parameters with:
docker run -it my-docker-image parameter3
which will be corresponding to:
/usr/bin/my-script.sh parameter3
I hope this makes sense.
In my Dockerfile it can easily be moved to ENTRYPOINT. No problems with that ;-)
from frontend.
Thank you.
Closing this now, as it's been answered in owntracks/recorder#388
from frontend.
Curious - which recorder version did you previously run? I just updated my recorder here to latest
and it still seems to work fine, but I'm using a slightly different (also traefik) setup.
from frontend.
I've got :latest
as well, however when it started to fail, I have done some investigation ;-)
According to https://hub.docker.com/r/owntracks/recorder/tags
it was 0.8.6-12
. It has been updated 6 days ago to version 0.8.8
...
from frontend.
I don't think we've changed anything which would cause this, @plague-doctor. What do you get when you invoke
curl http://a.b.c.d:8083/api/0/version
against the Recorder running in your container?
from frontend.
Ok, it looks like Recorder is binding to 127.0.0.1
instead to 0.0.0.0
:
# netstat -ntlp
tcp 0 0 127.0.0.1:8083 0.0.0.0:* LISTEN 13/ot-recorder
so I can nicely get response curl http://127.0.0.1:8083/api/0/version
from within the container:
{"version":"0.8.8","git":"0.8.8-0-g0f86aa3af8"}
but not from other container (in my case from otr-frontend).
Recorder keeps ignoring env. variable OTR_HTTPHOST=0.0.0.0
...
ot-recorder[9]: version 0.8.8 starting with STORAGEDIR=/store
ot-recorder[9]: connecting to MQTT ...
ot-recorder[9]: HTTP listener started on 127.0.0.1:8083
from frontend.
There's a OTR_HTTPHOST
in recorder.conf
in the container. What is that set to?
from frontend.
/config/recorder.conf
is pretty much empty, except:
OTR_TOPICS="owntracks/#"
I can see it is set via env variables:
OTR_PASS=<edited>
OTR_HOST=<edited>
OTR_USER=<edited>
OTR_HTTPHOST=0.0.0.0
OTR_STORAGEDIR=/store
OTR_TOPIC=owntracks/#
but it is ignored...
I have noticed there is another version released (0.9.0) but the behavior is the same.
ot-recorder[10]: version 0.9.0 starting with STORAGEDIR=/store
ot-recorder[10]: connecting to MQTT
ot-recorder[10]: HTTP listener started on 127.0.0.1:8083
ot-recorder[10]: Using storage at /store with precision 7
ot-recorder[10]: Subscribing to owntracks/# (qos=2)
from frontend.
It is misbehaving due to wrong entrypoint
in the Docker file. Currently there entrypoint is:
#!/bin/sh
if ! [ -f ${OTR_STORAGEDIR}/ghash/data.mdb ]; then
ot-recorder --initialize
fi
ot-recorder ${OTR_TOPIC}
which gives me the issue. The problematic bit is:
ot-recorder ${OTR_TOPIC}
which should be rather:
ot-recorder --http-host ${OTR_HTTPHOST:-0.0.0.0} --http-port ${OTR_HTTPPORT:-8083} $OTR_OPTIONS ${OTR_TOPICS:-owntracks/#}
I have came up with my Docker image (plaguedr/owntracks-recorder
) which works as expected. In case you are interested, here it is:
Dockerfile:
FROM owntracks/recorder
LABEL maintainer="Plague Doctor"
LABEL name="owntracks-recorder"
LABEL architecture="x86_64"
COPY start.sh /usr/bin/start.sh
RUN apk update && apk add mosquitto-clients && \
chmod 775 /usr/bin/start.sh
CMD ["start.sh"]
ENTRYPOINT []
and start.sh:
#!/bin/sh
while true; do
if mosquitto_sub -h "$OTR_HOST" -u "$OTR_USER" -P "$OTR_PASS" -p 1883 -t '$SYS/broker/uptime' -C 1 > /dev/null 2>&1; then
echo "MQTT is UP. Let's go!"
break
else
echo "MQTT is DOWN. Waiting..."
sleep 3
fi
done
#sh /usr/sbin/entrypoint.sh
if ! [ -f ${OTR_STORAGEDIR}/ghash/data.mdb ]; then
ot-recorder --initialize
fi
ot-recorder --http-host ${OTR_HTTPHOST:-0.0.0.0} --http-port ${OTR_HTTPPORT:-8083} $OTR_OPTIONS ${OTR_TOPICS:-owntracks/#}
from frontend.
That start.sh
looks useful. Can you enlighten (i.e. teach) me why you switched from ENTRYPOINT
to CMD
?
from frontend.
Related Issues (20)
- Timeline feature HOT 8
- [Feature] elevation change calculation HOT 6
- The frontend is only showing up once, then switching back to standard view on reload HOT 4
- 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
- Doesn't load map element HOT 5
- Include precompiled dist/ in releases HOT 4
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.