Reputation: 119
I was asked to externalize my properties file from my wars file and gave a file an external path, because I have a docker image with a tomcat Inside and I was asked to master the files outside my docker.
how to do that?
I already know how to modify the pom to exclude my file from the build.
Upvotes: 0
Views: 130
Reputation: 1734
You can mount a volume in docker container to a path in host machine. Now when you create any application.properties file on host machine path, same will be visible and accessible to docker container as well.
Below is the plain docker run
command to achieve it.
docker run -it --rm -v /home/k/myDocker:/k busybox sh
Below is the docker-compose.yml
approach
version: '3'
services:
prometheus:
image: prom/prometheus
volumes:
- prometheus-data:/prometheus
volumes:
prometheus-data:
driver: local
driver_opts:
o: bind
type: none
device: /disk1/prometheus-data
Upvotes: 1