Unable to finding the option to set docker workspace option when running the docker image
In docker build step options, I am unable to find the option to setup the working directory.
docker run -v /usr/src:/work -w /work maven:latest mvn package
Above command works fine while running via shell.
Same logic trying to achive using jenkins docker build step plugin. I can see bind the volume, but can’t see the working directory option. Anyone please suggest
One Solution collect form web for “Unable to finding the option to set docker workspace option when running the docker image”
Would an option be to use the
-onbuild Maven image variant? It has
WORKDIR set in the
Dockerfile: https://github.com/carlossg/docker-maven/blob/ecf54b9839caed8aa2bcf9b8f7bb19594634ee89/jdk-8/onbuild/Dockerfile. In this case you would just mount
/usr/src:/usr/src/app instead of
If the default
mvn install doesn’t work for you (
mvn install should includ the
package goal) you could always build your own base image that included a custom