# docker-multi-stage Spring Boot + Docker Multistage = Smaller container size Use can use prebuild version by using: ``` $ docker run -d -p 8080:8080 saboteurkid/smaller-spring:1.0 ``` Wait for docker to pull and up. Then jump to step [#6](#6-test-the-result) ## 1. Clone example project from Spring Boot repository ``` $ git clone https://github.com/spring-guides/gs-spring-boot.git $ cd gs-spring-boot/complete ``` ## 2. Create Dockerfile ``` $ wget https://gist.github.com/liemle3893/025624fc02dbecc0e8fd99a40a4ae94c/raw/7d5ed6c21fc981ce347bff5fcbea472fab988b26/Dockerfile ``` ## 3. Build the image ``` $ docker build -t saboteurkid/smaller-spring:1.0 . ``` ## 4. Check the images ``` $ docker images ``` You will see something like this: saboteurkid/smaller-spring 1.0 f880454cde3e 23 minutes ago 99.4MB ## 5. Create new container that run the newly created image $ docker run -d -p 8080:8080 saboteurkid/smaller-spring:1.0 ## 6. Test the result $ curl localhost:8080 You will received: `Greetings from Spring Boot!`