Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
d08b4367
Commit
d08b4367
authored
Nov 13, 2019
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Improve Deploying to Containers section"
See gh-18932
parent
6cf05aeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
deployment.adoc
...roject/spring-boot-docs/src/main/asciidoc/deployment.adoc
+19
-16
No files found.
spring-boot-project/spring-boot-docs/src/main/asciidoc/deployment.adoc
View file @
d08b4367
...
...
@@ -39,27 +39,30 @@ For example, using a `Dockerfile` you could express it in this form:
[indent=0]
----
FROM openjdk:8-jdk-alpine AS builder
WORKDIR target/dependency
ARG fatjar
COPY ${fatjar} app.jar
RUN jar -xf ./app.jar
FROM openjdk:8-jre-alpine
VOLUME /tmp
ARG DEPENDENCY=target/dependency
COPY --from=builder ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=builder ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=builder ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","com.example.MyApplication"]
----
and then build your docker image by passing the full path to your application jar:
FROM openjdk:8-jdk-alpine AS builder
WORKDIR target/dependency
ARG appjar
COPY ${appjar} app.jar
RUN jar -xf ./app.jar
FROM openjdk:8-jre-alpine
VOLUME /tmp
ARG DEPENDENCY=target/dependency
COPY --from=builder ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=builder ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=builder ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","com.example.MyApplication"]
----
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]
----
docker build --build-arg fatjar=./full/path/to/your/springboot/app.jar
docker build --build-arg appjar=path/to/myapp.jar .
----
[[cloud-deployment]]
== Deploying to the Cloud
Spring Boot's executable jars are ready-made for most popular cloud PaaS (Platform-as-a-Service) providers.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment