That Makefile is... weird. Why issue a "make sub-target" command? Makefiles are all about understanding dependencies, so you should actually be doing<p><pre><code> target: dependency
<commands>
</code></pre>
...instead of<p><pre><code> target:
make dependency
<commands>
</code></pre>
Doing it this way actually breaks dependency checks. It's just plain wrong.<p>Here's a "proper" Makefile, complete with conditionals, expansion, etc.:<p><a href="https://github.com/rcarmo/sushy/blob/master/Makefile" rel="nofollow">https://github.com/rcarmo/sushy/blob/master/Makefile</a><p>...and here's one of my Go Makefiles (no sub-targets here, but does vendoring in a way that's quite similar to what Go 1.5 turned out to adopt)<p><a href="https://github.com/rcarmo/go-rss2imap/blob/master/Makefile" rel="nofollow">https://github.com/rcarmo/go-rss2imap/blob/master/Makefile</a><p>(edit: whitespace)
Worth checking out docker-compose for more complex setups (if you need a Redis and PostgreSQL database running for example). I have been using it for Node.js development for the past few months and it is really a life changer especially if you are working on multiple projects concurrently. Pro-tip: `echo "alias dc=docker-compose" >> ~/.zshrc`
Why "FROM tianon/true" ? "FROM scratch" would be even smaller.
That's what we use in the docker swarm image: <a href="https://github.com/docker/swarm-library-image/blob/master/Dockerfile" rel="nofollow">https://github.com/docker/swarm-library-image/blob/master/Do...</a>
An improvement I'd make to this is not sending the current directory to docker, but rather a directory containing just the binary. That way you don't send a massive context to docker which you just throw away. (Especially in go projects which vendor in a lot of dependencies)