I'm building an customized Postgresql image in docker compose and following the successful build I'm trying to run a JAR file in the command label of the compose file. Is it possible to run the JAR from compose file? My docker-compose file looks like:
version: '2'
services:
pg-master:
build: .
ports:
- "5434:5432"
container_name: pg_master
command: java -Dlog4j.configuration=file:log4j.xml -jar abc.jar ABC
Try this. Create an init.sh file in the current directory like so
Your Dockerfile should look something like this (I've installed jre here too)
Remove the command property from your docker-compose file