title: Pull a file from a docker image in Golang to local file system
body: <p>I’m trying to figure out how I can use the Go client (<a href="http://godoc.org/github.com/moby/moby/client" rel="nofollow noreferrer">http://godoc.org/github.com/moby/moby/client</a>) to pull a file from a docker image at a specific version (tag)</p>
  
  <p>I want to download the image and then copy a file from the image onto the local file system. I see a lot of commands for dealing with an image, but not how to access its contents. I do see ways to access a container’s contents.</p>
  
  <p>I’m suspecting I would need to download the image, create a container with the image and finally copy the contents out of the container. Though if I could avoid creating a container, that would be preferred.</p>
  
  <p>Does anyone know exactly how to do this? Code snippet would be appreciated.</p>
  
  <p>Thanks!</p>