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.

  • Docker deployments fail on Marathon, work fine otherwise
  • How to run Eclipse with Docker on Windows using Boot2Docker?
  • How to pass command line arguments to a docker image
  • The relation between “docker/swarm” and “docker/swarmkit”
  • Difference between Rancher and other container orchestration
  • Docker daemon processes
  • 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)?

  • Docker execute ant script after tomcat starts?
  • Deploying project in Docker with Angular 4, Django and postgresql
  • Obtaining a docker image's parent images
  • Docker security issue
  • Improve performance of NGINX Server on a Worker Node
  • sonar-scanner- throws java.lang.ExceptionInInitializerError inside docker container
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.