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.

  • Docker swarm for usb devices
  • What's the difference between the docker commands: run, build, and create
  • Supervisor is not starting up
  • Running java command with Docker exec fails with “no such file or directory”
  • Cannot finde module 'express' (node app with docker)
  • Gulp not detecting file changes in subfolder
  • 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

  • Multiple FROMs - what it means
  • How to run Spark on Docker?
  • Using Docker-Compose to spin up multiple instances of a container with different configurations
  • Failure - Authentication is required to pull public docker images from Dockerhub registry
  • maven plugin for docker (e.g. to run with needed db)
  • Cannot kill pid 1 inside docker container with SIGKILL
  • 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.