Home > other >  Docker mount problem, ask for help
Docker mount problem, ask for help

Time:09-17

Start the container using the -v specified local file mounted to the container, lead to all containers all files under the directory is missing, the individual feels should be covered in the folder, turn to the great god, how to solve the following as startup code

Docker run - name bank - d - 8996: p. 8080 - v/home/bank_home/bank json:/usr/local/tomcat/webapps/bank/WEB - INF/classes/bank: 1.0.4



Below for the container after normal boot directory
Docker run - name bank - d - 8996 p: 8080 bank: 1.0.4


CodePudding user response:

Hello, you perform error caused by command, you write is the file to the directory to hang in the, this is wrong, should be hanging on to the directory, command: docker run - name bank - d - 8996: p. 8080 - v/home/bank_home/:/usr/local/tomcat/webapps/bank/WEB - INF/classes/bank: 1.0.4, remove the bank in your commands. Json, thank you

CodePudding user response:

First of all, -v volume mapping, equivalent to a host of directory mounted to the container corresponding directory, similar to our host partition file system mount, central plains covered container file directory;
Then, the above problem is because of mount, you command path error, the bank json, pay attention to the map is a path, not file, the correct command: docker run - name bank - d - 8996 p: 8080 - v/home/bank_home/:/usr/local/tomcat/webapps/bank/WEB - INF/classes/bank: 1.0.4

CodePudding user response:

The bank json removed

CodePudding user response:

Feeling is not you say this problem, this method also before I tried, finally found the reason, docker startup is to mount the directory and then start the tomcat, mount automatically created when the bank directory, then start tomcat decompression bank war, because there is the same directory, cannot normal decompression

CodePudding user response:

Docker startup is to mount the directory and then start the tomcat, mount automatically created when the bank directory, then start tomcat decompression bank war, because there is the same directory, cannot normal decompression
  • Related