Answer a question

I need an help to build the ci pipeline to build only docker-image and push it to docker hub(all are private repo. My requirement is, On git repo, I have Dockerfile something as below:

FROM tomcat:alpine
COPY snoop.war /opt/tomcat/tomcat1/webapps/
EXPOSE 8443
CMD /usr/local/tomcat/bin/cataline.bat run

In above Dockerfile, instead of "snoop.war" , I wanted to get the war file from "jfrog" artifcactory location directly as I cannot upload war file in git repo due to security policies. Expected Dockerfile should be:

FROM tomcat:alpine
COPY https://internal-jfrog-artifacts/war_file/mw_snapshots/snoop.war 
/opt/tomcat/tomcat1/webapps/
EXPOSE 8443
CMD /usr/local/tomcat/bin/cataline.bat run

Please assist,if this is possible by making some changes?

Answers

You need to download the file first. Try build with below Dockerfile.

FROM tomcat:alpine
RUN apk add curl --no-cache \
    && mkdir -p /opt/tomcat/tomcat1/webapps \
    && curl -fsSL -o /opt/tomcat/tomcat1/webapps/snoop.war https://internal-jfrog-artifacts/war_file/mw_snapshots/snoop.war
EXPOSE 8443
CMD /usr/local/tomcat/bin/cataline.bat run
Logo

ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!

更多推荐