How can I execute a command before start my application?
My application is a sprint boot app. I use jib to build my docker image. I'd like to download a jar in the container and set the jar as the agent. I can set the jar via jvmFlags. How can I download the jar before starting the ever? Like that in my Dockerfile below.
FROM openjdk:8-jre-alpine
COPY app.jar app.jar
RUN curl -O https://website.com/java-agent/download/agent.zip
RUN unzip /tmp/agent.zip -d /opt && ls /opt/agent.jar
ENV JAVA_OPTS="-javaagent:/opt/agent.jar "
ENTRYPOINT exec java ${JAVA_OPTS} -jar app.jar
Hello! If you want to download and unpack something, you could set up your Maven or Gradle build to do so. This example setup might help.
Hello! If you want to download and unpack something, you could set up your Maven or Gradle build to do so. This example setup might help.
Thanks.
Closing this issue. Feel free to reopen it if you have any further questions!