title: How to split docker layer?
body: <p>My Dockerfile looks like</p>
  
  <pre><code>RUN echo "Downloading huge file" &amp;&amp; \
    wget   http://server/huge.tar.gz  &amp;&amp; \
    echo "Extracting huge file" &amp;&amp; \
    tar xzf huge.tar.gz  &amp;&amp; \
    huge/install /opt/myinstall &amp;&amp; \
    rm -rf huge*
  </code></pre>
  
  <p>Actually, I am </p>
  
  <ol>
  <li>Downloading some third party installation package</li>
  <li>Unpacking</li>
  <li>Running install</li>
  <li>Removing installation files</li>
  </ol>
  
  <p>Docker build succeeds  and I can use my new container.</p>
  
  <p>Problem starts when I am pushing to Amazon Container registry.</p>
  
  <p>Push is  rejected because last layer is huge ( ~about 20G).</p>
  
  <p>20G is a real size of installation, so I can do a little to decrease it.</p>
  
  <p>My question is how can I split a layer to some smaller layers to accommodate Amazon layer size limit?</p>