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:

  • Deploying Java War to Tomcat in Docker, error No Spring WebApplicationInitializer types detected on classpath
  • Docker build from local Dockerfile hangs (Windows 10)
  • Reuse containers with `docker-compose`
  • how to create docker entrypoint with parameters
  • How can I run Ghost in Docker with the google/node-runtime image?
  • Docker Networking: Auto-discovering host names in a bridge network
  • 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.

  • Docker image seemingly having missing layers
  • openerp-server: error: no such option: -p
  • gcloud docker documentation might need an update
  • Reverse proxy between a unicorn server and Galera cluster
  • Dockerfile with node, java, and Dynamodblocal
  • Missing UDP packets between docker containers
  • 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.