How to use war file from jfrog artifactory to Dockerfile in github repo
·
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
更多推荐


所有评论(0)