Polish "Improve Deploying to Containers section"
See gh-18932
This commit is contained in:
parent
6cf05aeb50
commit
d08b436735
|
@ -41,8 +41,8 @@ For example, using a `Dockerfile` you could express it in this form:
|
||||||
----
|
----
|
||||||
FROM openjdk:8-jdk-alpine AS builder
|
FROM openjdk:8-jdk-alpine AS builder
|
||||||
WORKDIR target/dependency
|
WORKDIR target/dependency
|
||||||
ARG fatjar
|
ARG appjar
|
||||||
COPY ${fatjar} app.jar
|
COPY ${appjar} app.jar
|
||||||
RUN jar -xf ./app.jar
|
RUN jar -xf ./app.jar
|
||||||
|
|
||||||
FROM openjdk:8-jre-alpine
|
FROM openjdk:8-jre-alpine
|
||||||
|
@ -53,13 +53,16 @@ For example, using a `Dockerfile` you could express it in this form:
|
||||||
COPY --from=builder ${DEPENDENCY}/BOOT-INF/classes /app
|
COPY --from=builder ${DEPENDENCY}/BOOT-INF/classes /app
|
||||||
ENTRYPOINT ["java","-cp","app:app/lib/*","com.example.MyApplication"]
|
ENTRYPOINT ["java","-cp","app:app/lib/*","com.example.MyApplication"]
|
||||||
----
|
----
|
||||||
and then build your docker image by passing the full path to your application jar:
|
|
||||||
|
Assuming the above `Dockerfile` is the current directory, your docker image can be built specifying the path to your application jar, as show in the following example:
|
||||||
|
|
||||||
[indent=0]
|
[indent=0]
|
||||||
----
|
----
|
||||||
docker build --build-arg fatjar=./full/path/to/your/springboot/app.jar
|
docker build --build-arg appjar=path/to/myapp.jar .
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[[cloud-deployment]]
|
[[cloud-deployment]]
|
||||||
== Deploying to the Cloud
|
== Deploying to the Cloud
|
||||||
Spring Boot's executable jars are ready-made for most popular cloud PaaS (Platform-as-a-Service) providers.
|
Spring Boot's executable jars are ready-made for most popular cloud PaaS (Platform-as-a-Service) providers.
|
||||||
|
|
Loading…
Reference in New Issue