Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker not mounting a folder as volume

Tags:

docker

I have a tomcat6 image which uses /usr/local/tomcat as catalina home. I am trying to mount a volume using this command:

docker run -d -p 8080:8080 -v  /home/ubuntu/Springmvc:/usr/local/tomcat/webapps tomcat6.

When I browse to the container URL I can see tomcat running correctly (no error message) but there are no available applications.

I followed Docker's official volume documentation at http://docs.docker.com/userguide/dockervolumes

I am using docker on ubuntu.

Springmvc is my project folder.

Where am I going wrong?

like image 882
user2451997 Avatar asked Feb 02 '15 07:02

user2451997


1 Answers

I suspect the problem is you need to mount the directory inside the webapps folder, not over the top of it e.g: -v /home/ubuntu/Springmvc:/usr/local/tomcat/webapps/Springmvc

like image 80
Adrian Mouat Avatar answered Sep 28 '22 08:09

Adrian Mouat