I am using adoptopenjdk/openjdk11:alpine-jre
base image for java and trying below instruction inside my Dockerfile,
RUN wget -O dd-java-agent.jar "https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.datadoghq&a=dd-java-agent&v=LATEST"
which produces an error: Connecting to repository.sonatype.org (18.208.14.211:443) wget: server returned error: HTTP/1.1 307 Temporary Redirect
Is there a way to download the latest version of jar file from nexus using wget utility available with Busybox?
Alpine version: v3.12.0 | Busybox version: v1.31.1
Note: If I specify the exact version of jar like RUN wget -O dd-java-agent.jar 'https://repository.sonatype.org/service/local/repositories/central-proxy/content/com/datadoghq/dd-java-agent/0.38.0/dd-java-agent-0.38.0.jar'
it succeeded. I am aware of other option is to use curl in this case. Just trying to keep it simple and avoiding the installation of curl, its usage, and then removal.
Starting from BusyBox 1.34.0 (19 August 2021) the 307 and 308 redirects are supported. Commit e71ea6c1f84318d8655a5783736288695174f596