Docker commands to run popular images

Maven

Navigate to the Maven project directory on your workstation and launch the Maven container.

To run a Maven project by using the Maven Docker image directly, passing a Maven command to docker run.

docker run -it --rm --name my-maven-project -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven:3.3-jdk-8 mvn clean install

To launch the Maven Docker container and open a Bash terminal in the container for an interactive session.

docker run -it --name my-maven-project -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven:3.3-jdk-8 bash

 

Leave a comment

Your email address will not be published. Required fields are marked *