sprintboot docker deployment

build code

1
2
3
git clone https://github.com/mengxu2018/springboot.git
cd springboot/spring-boot-crud
mvn package # will generate spring-boot-crud.jar under target directory

build docker image

1
2
docker build -t springboot-crud-sample .
docker inspect springboot-crud-sample # you will find userful info under node "ContainerConfig"

run docker image

1
2
docker run -d -p 9080:8080 springboot-crud-sample
docker inspect 573fcd31c442 # 573fcd31c442 is the container id, can find "Mounts" here

test the client

visit http://192.168.77.140:9080/