tl;dr: when mounting volumes in Kubernetes, they have to match the dockerfile VOLUME directives exactly, or you’ll regret it later…

I’ve been a happy docker and docker-compose user, mounting host volumes liberally both in development and production to nicely separate data (which I need to backup) from executable code (which…

tl;dr: if you use docker with single file volume bindings, you need to instruct your IDE / text editor to save files in-place. Otherwise, your containers won’t see your updates until you restart them.

You’re happily working in your docker environment, for example modifying a local config file and reloading…

Hey, seems I’m bad at blogging but good at getting (and solving) weird Docker error message, so here goes:

You’re happily developing with docker, but suddenly your docker-compose build commands start giving you errors:

ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`

You know docker is there, you’re using it right now! docker ps works fine, so what gives? Well, it appears you also get this message when you don’t have the permission to read some files in your docker build context! Just run docker build . and you’ll get a clearer error message (hopefully).

If it is indeed unreadable files, then add them to your .dockerignore, or just change their permissions.

Problem solved, back to happy dockering.

Well, this just cost me several hours, and I couldn’t find it anywhere else, so let’s start this blog with a note to self:

  • If you’re doing some docker stuff (like building an alpine image) and your docker build fails with some DNS error
  • but your host has no issue resolving the names
  • and your /etc/resolv.conf in both environments look fine (= they are just a list of nameservers)
  • then validate each DNS entry: dig google.com @ip.of.your.nameserver
  • and remove any non-responding entry!

In my case, my last nameserver entry was incorrect, which my host computer had not issue with, but blew up my docker build process every time.

Xavier Priour

😍 tech, comics and games. CTO at AssetSagacity.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store