Force Docker to cache directory

Is it possible to force Docker to cache a directory?

I would like to do this because I am using vendoring in Go 1.6 (via Glide) and a majority of my build times are spent fetching the same dependencies as the previous build.

  • Vagrant with Docker Provider fails with rsync over ssh
  • 2 processes on same port?
  • importerror:no module name docker.client
  • Unable to access docker containers from host over macvlan network
  • Docker : Persisting build argument in container during run?
  • Mount git branches in a container
  • If there is a way of forcing Docker to cache a directory, is there any way to let Docker know when to invalidate the cache (ex., when glide.lock changes)?

  • Building on a docker image that sets user to an unprivileged user
  • Docker with Angular 4 and Django is compiled successfully but localhost:4200 is not working
  • Is it possible to get terminal notifications in OSX through a docker container?
  • How to pass command line arguments in kubernetes?
  • Docker running on Centos7 with a Windows 7 container
  • Angular & Docker: Environment aware configuration
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.