title: Canonical way to checksum downloads in a Dockerfile?
body: <p>I'm creating a Dockerfile that downloads, builds, installs node.js from source.  I'd like to <a href="http://nodejs.org/dist/latest/SHASUMS.txt" rel="noreferrer">checksum</a> the download before building it, and stop or exit the Dockerfile if the checksum fails:</p>
  
  <pre><code># officially supported ubuntu
  FROM ubuntu:12.04
  
  # SETUP
  RUN cd /tmp
  RUN apt-get update -y
  RUN apt-get install wget build-essential automake -y
  RUN wget http://nodejs.org/dist/latest/node-v0.10.26.tar.gz
  RUN wget http://nodejs.org/dist/latest/SHASUMS256.txt
  
  # RUN checksum: exit on fail, continue on success
  ??? how ???
  
  # INSTALL
  RUN tar -xvf node-v0.10.26.tar.gz &amp;&amp; cd node-v0.10.26
  RUN ./configure &amp;&amp; make &amp;&amp; make install
  
  # CLEANUP
  apt-get autoremove --purge wget build-essential automake -y
  </code></pre>
  
  <p>Has the Docker community settled on a 'best practices' way of doing this?</p>