boot2docker (windows vm) has issues when trying to run
paul42 opened this issue · 13 comments
I'm guessing because boot2docker is incredibly lightweight it doesn't have all the volumes?
docker@boot2docker:$ docker run -d -v /etc/localtime:/etc/localtime:ro -p 80:80 -p 8125:8125/udp -p 8126:8126 --name kamon-grafana-dashboard kamon/grafana_graphite$
a4d3e7677c8337f3b56f2c1970e7745adcbcc4334445a976d45c64b00aa7160e
2014/09/05 18:22:31 Error response from daemon: Cannot start container a4d3e7677c8337f3b56f2c1970e7745adcbcc4334445a976d45c64b00aa7160e: setup mount namespace bind mounts mounting /etc/localtime into /mnt/sda1/var/lib/docker/aufs/mnt/a4d3e7677c8337f3b56f2c1970e7745adcbcc4334445a976d45c64b00aa7160e/etc/localtime not a directory
docker@boot2docker:
when I delete the -v flag and the volumes I can run. I'm going to skim the docs and see what that does and find out how to remedy on boot2docker (sorry, I'm linux weak)
@paul42 you are correct in that.. we merged some upgrades this morning that make the timezone configuration unnecessary, I'll let you known when the updated image hits the registry!
thanks! I love the package you guys put together! I still need to find out/research what exactly the /etc/localtime:ro means, I am assuming it's a way to track timezone / time configs? does the :ro flag in docker mean read only?
mounting /etc/localtime is just about making sure that the docker container has the same timezone that the docker host has, to make sure that everything is displayed in local time on the grafana dashboard.. this is no longer necessary in the latest grafana release (in fact, it wasn't necessary before, we just found it convenient)... and yes, the :ro
is part is for making it read-only.
Any updates on this bug ? Unable to run the current codebase on OSX. Keep hitting this error :
Error response from daemon: Cannot start container 2f098ab6512677b1f85779f9836948df37ca34fbc516c7d15025978d9d0c816b: setup mount namespace bind mounts mounting /etc/localtime into /mnt/sda1/var/lib/docker/aufs/mnt/2f098ab6512677b1f85779f9836948df37ca34fbc516c7d15025978d9d0c816b/etc/local
@thebitmonk please take a look at the start
script, we no longer need to mount /etc/localtime
, please run your container by using:
docker run -d -p 80:80 -p 8125:8125/udp -p 8126:8126 --name kamon-grafana-dashboard kamon/grafana_graphite
let us know if you have any issues!
@ivantopo Thanks. I was able to get it up and running.
@thebitmonk I'm glad you got it working, I'll proceed to close this issue.. feel free to ask anything you might need in our mailing list, regards!
@ivantopo if let timezone not set for the container, timestamp in the log file is not easy to read
hello @quxiaojing, can you please share what exactly do you mean by not easy to read?
@ivantopo for example,my timezone is Asia/Shanghai,then supervisord.log show some line like
2015-03-05 11:47:46,688 INFO supervisord started with pid 1
when my expectation is
2015-03-05 19:47:46,688 INFO supervisord started with pid 1
timestamp in the log file is the UTC time, not my localtime
Now I see what you mean. As far as I could investigate there is no other "official" way to set the container's timezone other than mounting /etc/localtime
but as witnessed here, it doesn't work in all platforms.
Our initial motivation to suggest mounting /etc/localtime
was that it wasn't obvious how to configure Graphite/Grafana to properly show the correct times both while displaying relative (last X time) and absolute (from x to y) metric queries. After our initial efforts Grafana got a lot smarter in this matter and now it simply works with Graphite on UTC and Grafana detecting the user's timezone, that's why after the upgrade we didn't recommend mounting /etc/localtime
anymore.
Although we wont recommend it anymore, you can still mount /etc/localtime
if you want to! Fortunately that's a deployment decision that you can make just by adding one more option in the command line :).
@ivantopo Thanks for reply , I found the reason why we can mount /etc/localtime, it's because the host which run the docker damon don't have the file /etc/localtime, especially on the boot2docker-vm. so i need to customize my boot2docker-vm to resolve this problem.
@quxiaojing please share if you find any suitable solution.