I am using apiman tool inside docker. I have developed one custom policy. When I run apiman in standalone mode ( without docker ), apiman is able to take that war ( policy) from .m2 repository. But when I use apiman inside docker it does not work.
- Is there any way to having .m2 repository inside docker container along with wildfly server? Would multi stage build will help here and how?
Here is my dockerfile
FROM jboss/wildfly:10.1.0.Final
COPY apiman_folder ${JBOSS_HOME}
#EXPOSE 8080 9990
USER root
RUN chown -R jboss:0 ${JBOSS_HOME} \
&& chmod -R g+rw ${JBOSS_HOME}
USER jboss
ENTRYPOINT ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "-c", "standalone-apiman.xml"]
Yes multi-stage build can solve the problem if you want to build the project when building the image in Docker file example :
doc links
The docker docs for more info
Maven official image available in dockerhub
APIman structure course
I think it's better if you build the project on-premise in your machine then copy the policy and build the image with the initial Dockerfile (copy just the policy and not the whole .m2).