title: Does Alpine Linux handle certs differently than Busybox?
body: <p>I started with a base image errordeveloper/oracle-jdk.  This Dockerfile is shown here for reference:</p>
  
  <pre><code>FROM        progrium/busybox 
  MAINTAINER  Ilya Dmitrichenko &lt;errordeveloper@gmail.com&gt;
  
  RUN opkg-install curl ca-certificates
  
  ENV JAVA_HOME /usr/jdk1.8.0_31
  
  RUN curl \
    --silent \
    --location \
    --retry 3 \
    --cacert /etc/ssl/certs/GeoTrust_Global_CA.crt \
    --header "Cookie: oraclelicense=accept-securebackup-cookie;" \
    "http://download.oracle.com/otn-pub/java/jdk/8u31-b13/jdk-8u31-linux-x64.tar.gz" \
      | gunzip \
      | tar x -C /usr/ \
      &amp;&amp; ln -s $JAVA_HOME /usr/java \
      &amp;&amp; rm -rf $JAVA_HOME/src.zip $JAVA_HOME/javafx-src.zip $JAVA_HOME/man
  
  ENV PATH ${PATH}:${JAVA_HOME}/bin
  
  ENTRYPOINT [ "java" ]
  CMD [ "-version" ]
  </code></pre>
  
  <p>I'd like to move this to Alpine Linux, so a made the following changes:</p>
  
  <pre><code>FROM        alpine
  MAINTAINER  Ilya Dmitrichenko &lt;errordeveloper@gmail.com&gt;
  
  RUN apk --update upgrade &amp;&amp; apk add curl ca-certificates &amp;&amp; rm -rf /var/cache/apk/*
  
  ENV JAVA_HOME /usr/jdk1.8.0_31
  
  RUN curl \
    --silent \
    --location \
    --retry 3 \
    --cacert /etc/ssl/certs/GeoTrust_Global_CA.crt \
    --header "Cookie: oraclelicense=accept-securebackup-cookie;" \
    "http://download.oracle.com/otn-pub/java/jdk/8u31-b13/jdk-8u31-linux-x64.tar.gz" \
      | gunzip \
      | tar x -C /usr/ \
      &amp;&amp; ln -s $JAVA_HOME /usr/java \
      &amp;&amp; rm -rf $JAVA_HOME/src.zip $JAVA_HOME/javafx-src.zip $JAVA_HOME/man
  
  ENV PATH ${PATH}:${JAVA_HOME}/bin
  
  ENTRYPOINT [ "java" ]
  CMD [ "-version" ]
  </code></pre>
  
  <p>Mainly I changed the package management tool to pull down curl and ca-certificates.  </p>
  
  <p>After confirming the original builds clean on my machine (it does) I tried my version and got this error: (I turned off --silent on the curl to see it)</p>
  
  <pre><code>Step 4 : RUN curl   --location   --retry 3   --cacert /etc/ssl/certs/GeoTrust_Global_CA.crt   --header "Cookie: oraclelicense=accept-securebackup-cookie;"   "http://download.oracle.com/otn-pub/java/jdk/8u31-b13/server-jre-8u31-linux-x64.tar.gz"     | gunzip     | tar x -C /usr/     &amp;&amp; ln -s $JAVA_HOME /usr/java     &amp;&amp; rm -rf $JAVA_HOME/man
   ---&gt; Running in c91e4939f851
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
    0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  curl: (77) error setting certificate verify locations:
    CAfile: /etc/ssl/certs/GeoTrust_Global_CA.crt
    CApath: none
  gunzip: invalid magic
  tar: short read
  The command '/bin/sh -c curl   --location   --retry 3   --cacert /etc/ssl/certs/GeoTrust_Global_CA.crt   --header "Cookie: oraclelicense=accept-securebackup-cookie;"   "http://download.oracle.com/otn-pub/java/jdk/8u31-b13/server-jre-8u31-linux-x64.tar.gz"     | gunzip     | tar x -C /usr/     &amp;&amp; ln -s $JAVA_HOME /usr/java     &amp;&amp; rm -rf $JAVA_HOME/man' returned a non-zero code: 1
  </code></pre>
  
  <p>Does Alpine do something different here?  Why might my curl/certs be failing?</p>