Unable to finding the option to set docker workspace option when running the docker image

I have installed docker build step plugin in jenkins. Using that plugin trying to compile java application using maven image.

In docker build step options, I am unable to find the option to setup the working directory.

  • AWS cloudwatch terminal output logs
  • Restarting process with pid 1 in docker swarm container (replica)
  • How to set hostname in global service in Docker Swarm
  • Fedora docker.io seems to not support btrfs
  • nginx default_site doesn't appear to be working
  • How to create a virtual cluster using docker on a single node?
  • 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

  • Install mysqlclient-python in Docker
  • Not able to create report on protractor tests in docker container
  • Can't get clipboard forwarding working, while being in Docker under SSH
  • Docker pull/push using private registry without prefixing
  • What work does the process in container “gcr.io/google_containers/pause:0.8.0” do?
  • Installing PostgreSQL within a docker container
  • 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 /work.

    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 WORKDIR.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.