From a94f441f44a845b69647247ecf342c480e592a34 Mon Sep 17 00:00:00 2001 From: Nicholas Mucks Date: Sun, 14 Jul 2024 12:27:36 -0700 Subject: [PATCH] update docker and add an automation.sh --- Dockerfile | 2 +- automation.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 automation.sh diff --git a/Dockerfile b/Dockerfile index 90c172a44..9b27efd64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use an official OpenJDK runtime as a parent image -FROM openjdk:17-jdk-alpine +FROM openjdk # Set the working directory inside the container WORKDIR /app diff --git a/automation.sh b/automation.sh new file mode 100644 index 000000000..510be42fc --- /dev/null +++ b/automation.sh @@ -0,0 +1,14 @@ +echo "####################################################" +echo "Stop and remove all running containers..." +echo "docker stop $(docker ps -a -q)" +echo "docker system prune -af" +docker stop $(docker ps -a -q) +docker system prune -af + +echo "####################################################" +echo "Build and run container..." +echo "build . -f spring_image" +echo "docker run -itd --net=assignment2 -p:8080:8080 --name spring-clinic spring_image" +docker build . -f spring_image +docker run -itd --net=assignment2 -p:8080:8080 --name spring-clinic spring_image +