Docker for devs with hands-on| Part-5

FROM openjdk:8u312-jdk
MAINTAINER Aditya Goel "adityagoel123@gmail.com"
EXPOSE 8080
WORKDIR /usr/local/bin/
COPY fleetman-0.0.1-SNAPSHOT.jar webapp.jar
CMD ["java", "-Dspring.profiles.active=docker-demo", "-jar", "webapp.jar"]
docker image build -t webapp-springboot-aditya .
docker images
docker container run -itd -p 8089:8080 <NAME_OF_DOCKER_IMAGE>
docker container exec -it d1 bash
docker containers ps
docker container run -d -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=fleetman mysql:5
docker images
docker container ps -a
docker container exec -it e7 bash
docker network ls
docker network create <NAME_OF_NETWORK>
docker container run -d -e MYSQL_ROOT_PASSWORD=password --e MYSQL_DATABASE=fleetman --network aditya-network --name mysqldbpanga mysql:5
docker container run -itd -p 8086:8080 --network aditya-network --name humanfleetasia webapp-springboot-aditya
docker container exec --it 3b bash
apt-get update && apt-get install iputils-ping
ping <NAME_OF_OTHER_CONTAINER>
FROM openjdk:8u312-jdk
MAINTAINER Aditya Goel "adityagoel123@gmail.com"
EXPOSE 8080
WORKDIR /usr/local/bin/
COPY fleetman.jar webapp.jar
CMD ["java", "-Dspring.profiles.active=docker-demo", "-jar", "webapp.jar"]
docker image build -t fleetmanjarimage5 .
docker images
docker container run -itd -p 8085:8080 --network aditya-network --name fleetmantrackercontainer4 fleetmanjarimage5
docker volume ls
docker container run -v mysqldata:/var/lib/mysql -d -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=fleetman --network aditya-network --name mysqldbpanga mysql:5
docker volume inspect <NAME_OF_VOLUME>
docker container run -v /Users/B0218162/Documents/LEARNINGS/MEDIUM-BLOG/Docker/DOCKER_LEARN/DATA_DIR_FOR_CONTAINER:/var/lib/mysql -d -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=fleetman --network aditya-network --name mysqldbpanga mysql:5
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.21.0</version>

<configuration>
<dockerHost>unix:///var/run/docker.sock</dockerHost>
<verbose>true</verbose>
<images>
<image>
<name>adityagoel123/fleetman-web-with-mysql</name>
<build>

<dockerFileDir>${project.basedir}/src/main/docker/</dockerFileDir>

<!--copies artficact to docker build dir in target-->
<assembly>
<descriptorRef>artifact</descriptorRef>
</assembly>
<tags>
<tag>latest</tag>
<tag>${project.version}</tag>
</tags>
</build>
</image>
</images>
</configuration>
</plugin>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store