Docker: wget for https does not work

In my docker file I have below command

RUN wget -o test.jar https://bintray.com/artifact/download/thesamet/maven/gerrit-saml-plugin-2.11.4-2.jar

But in build I get below error:

  • Moving files into a Docker Data Volume
  • Running a cronjob or task inside a docker cloud container
  • Why is my docker CI image not reproducible / running everywhere
  • Docker Compose and rabbitmq docker image plugins
  • How to get the clients external ip, im using Gcloud/kubernetes
  • how to schedule job with the monitoring of cpu,memory, disk io, etc.
  • The command '/bin/sh -c wget -o test.jar https://bintray.com/artifact/download/thesamet/maven/gerrit-saml-plugin-2.11.4-2.jar' returned a non-zero code: 8
    

    I tried --no-check-certificate and -U but got same error.

  • Run Chromium inside container: Error = seccomp-bpf failure in syscall 0241
  • How to enable gerrit hooks?
  • Host verification failed error when running git clone inside dockerfile on AWS EC2 instance as host and a private git repository
  • docker stop && docker rm doesn't really get rid of my container
  • How do I list all containers in a user-defined docker network?
  • Cannot attach debugger to a node.js application running inside a Docker container in host-mode
  • 2 Solutions collect form web for “Docker: wget for https does not work”

    Below command works. I should have used ADD

    ADD https://bintray.com/artifact/download/thesamet/maven/gerrit-saml-plugin-2.11.4-2.jar .
    

    The manual of wget says that -o specifies where log messages are written to. This mean the option -o test.jar causes that error messages are written to test.jar instead of stderr. You will not see any error messages on stderr and you will not download the file to test.jar.

    The following command works on my pc and if any error occurs, you should see a message now:

    wget -O test.jar https://bintray.com/artifact/download/thesamet/maven/gerrit-saml-plugin-2.11.4-2.jar
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.