Part3
This commit is contained in:
parent
1a5357e1df
commit
e98d78b444
16 changed files with 109 additions and 8 deletions
16
Part3/Exercise10/Dockerfile
Normal file
16
Part3/Exercise10/Dockerfile
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Using the -slim images instead of alpine, because the alpine images threw error:
|
||||
# library initialization failed - unable to allocate file descriptor table - out of memory
|
||||
# and I didn't want to submit something that required modifying Docker settings
|
||||
FROM openjdk:8-jdk-slim as build
|
||||
WORKDIR /usr/src/app
|
||||
COPY pom.xml ./
|
||||
COPY . .
|
||||
RUN ./mvnw package
|
||||
|
||||
FROM openjdk:8-jre-slim
|
||||
EXPOSE 8080
|
||||
WORKDIR /usr/src/app
|
||||
COPY --from=build /usr/src/app/target/docker-example-1.1.3.jar .
|
||||
RUN useradd -m appuser
|
||||
USER appuser
|
||||
CMD ["java", "-jar", "./docker-example-1.1.3.jar"]
|
2
Part3/Exercise10/sizes.txt
Normal file
2
Part3/Exercise10/sizes.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
Before: 435MB
|
||||
After: 213MB
|
Reference in a new issue