You can use the &quot;dockerception&quot; method: build in a container with devtools, then import the resulting binaries into a container with no devtools.
<a href="https:&#x2F;&#x2F;github.com&#x2F;jamiemccrindle&#x2F;dockerception" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jamiemccrindle&#x2F;dockerception</a><p>The resulting images can be very small:
<a href="https:&#x2F;&#x2F;hub.docker.com&#x2F;r&#x2F;jjclark&#x2F;nethack&#x2F;tags&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hub.docker.com&#x2F;r&#x2F;jjclark&#x2F;nethack&#x2F;tags&#x2F;</a><p>It&#x27;s currently a little difficult because of a bug with building from a tarball:
<a href="https:&#x2F;&#x2F;github.com&#x2F;docker&#x2F;docker&#x2F;issues&#x2F;15785" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;docker&#x2F;docker&#x2F;issues&#x2F;15785</a>