Wednesday, 25 August 2021

Docker sample

 FROM maven:3.6.0-jdk-8-alpine AS MAVEN_BUILD

MAINTAINER Sushil
COPY pom.xml /build/
COPY src /build/src/
WORKDIR /build/
RUN mvn package
FROM openjdk:8-jre-alpine
WORKDIR /app
COPY --from=MAVEN_BUILD /build/target/name.jar /app/
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "name.jar"]

docker command

 


sudo docker image build -t sushil/verification ./


sudo docker container run -d -p 8087:8080 sushil/verification


list of images::


sudo docker ps


sudo docker logs -f d44b2b216e16


sudo docker exec -it d44b2b216e16 sh


tail -f verification.log


help:  https://dzone.com/articles/build-package-and-run-spring-boot-apps-with-docker



stop::


docker stop <container-name>

links for Data Structure

  1) 𝐁𝐞𝐜𝐨𝐦𝐞 𝐌𝐚𝐬𝐭𝐞𝐫 𝐢𝐧 𝐋𝐢𝐧𝐤𝐞𝐝 𝐋𝐢𝐬𝐭:  https://lnkd.in/gXQux4zj 2) 𝐀𝐥𝐥 𝐭𝐲𝐩𝐞𝐬 𝐨𝐟 𝐓𝐫𝐞𝐞 𝐓𝐫𝐚𝐯𝐞𝐫𝐬𝐚𝐥𝐬...