-
Notifications
You must be signed in to change notification settings - Fork 550
Open
Description
Hi, thank you for the fast response.
I want to reproduce some think like this .
# First stage: **build environment**
FROM maven:3.5.0-jdk-8-alpine **AS builder**
# add pom.xml and source code
ADD ./pom.xml pom.xml
ADD ./src src/
# package jar
RUN mvn clean package
# Second **stage: minimal runtime environment**
From openjdk:8-jre-alpine
# copy jar from the first stage
COPY **--from=builder** target/my-app-1.0-SNAPSHOT.jar my-app-1.0-SNAPSHOT.jar
EXPOSE 8080
CMD ["java", "-jar", "my-app-1.0-SNAPSHOT.jar"]
So I want to create a first stage to build the project, then create a second stage to copy the artifact from the first stage and run it.
I tried to do this, but I was blocked in the second stage.
new DockerFileBuilder()
.basedir("/")
.baseImage("**maven:3.5.0-jdk-8-alpine** ### **AS** **builder**")
.expose(Collections.singletonList("8080"))
/////
/////
.entryPoint(a)
.write(javaProject.getWorkDir().toFile());
thank you .
Originally posted by @bramlihamza in #1708 (reply in thread)
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
add Multistage dockerFile issue eclipse-jkube#1733
add Multistage dockerFile issue eclipse-jkube#1733