Skip to content

Instantly share code, notes, and snippets.

@pranaybathini
Created April 29, 2021 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pranaybathini/7657028a247a8b6b814bdf9e93882771 to your computer and use it in GitHub Desktop.
Save pranaybathini/7657028a247a8b6b814bdf9e93882771 to your computer and use it in GitHub Desktop.
# Step 0: A. Stop existing container and remove it. B. Remove the old image.
docker ps -q --filter "name=quartz-scheduler" | grep -q . && docker stop quartz-scheduler && docker rm -fv quartz-scheduler && docker rmi quartz-scheduler
# Step 1: Create a new jar
mvn clean install
# Step 2: Dockerize with Dockerfile
docker build -t quartz-scheduler .
# Step 3: Run the container
docker run --name quartz-scheduler --add-host=host.docker.internal:host-gateway --env SPRING_PROFILES_ACTIVE=local-postgres -p 9166:9166 -d quartz-scheduler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment