user2424726
user2424726

Reputation: 71

Mounting directory in docker container and running Gradle command

I have a docker container named mydockimage with gradle installed in it.

I am mounting my local work directory with following command

sudo docker run -t -a stdout -a stderr --rm \
  --volume /home/Myworkspace/Myproject:/workspace:rw myimage:myimage_build 

I have the following issues:

  1. after running this command from /home, I get redirected to the docker contanier /workspace folder but when i run gradle the response hangs.

  2. if i run the mount script from my local workspace folder then its redirects me to docker container with all the files but with the folder name and git branch name in the flower bracket something like below

    [ root@c6ff3f80dab8:/workspace {COE *} ]$
    

    where COE is the branch name.

  3. If I run gradle build in the [ root@c6ff3f80dab8:/workspace {COE *} ]$ then application builds but returns back to my local directory and not sure how to find in my docker container.

Upvotes: 3

Views: 1410

Answers (1)

neciu
neciu

Reputation: 4485

To find your docker container run command: docker ps. It will display running containers. docker ps -a will display all containers even closed ones.

Please provide your Dockerfile and command you build your image.

Upvotes: 1

Related Questions