Closed cmoulliard closed 6 years ago
If I get the logs of the draftd pod, then I can figure out the error (= uberjar file not generated locally)
Step 1/9 : FROM maven:3.5-jdk-8 as BUILD
Step 1/9 : FROM maven:3.5-jdk-8 as BUILD
---> 76c9ab5df55b
Step 2/9 : COPY . /usr/src/app
---> 76c9ab5df55b
Step 2/9 : COPY . /usr/src/app
---> Using cache
---> cc09f2f77811
Step 3/9 : RUN mvn --batch-mode -f /usr/src/app/pom.xml clean package
---> Using cache
---> cc09f2f77811
Step 3/9 : RUN mvn --batch-mode -f /usr/src/app/pom.xml clean package
---> Using cache
---> 6431bd82c14b
Step 4/9 : FROM openjdk:8-jdk
---> Using cache
---> 6431bd82c14b
Step 4/9 : FROM openjdk:8-jdk
---> 891c9734d5ab
Step 5/9 : ENV PORT 4567
---> 891c9734d5ab
Step 5/9 : ENV PORT 4567
---> Using cache
---> 7b227b709677
Step 6/9 : EXPOSE 4567
---> Using cache
---> 7b227b709677
Step 6/9 : EXPOSE 4567
---> Using cache
---> 393911eb3cdf
---> Using cache
---> 393911eb3cdf
Step 7/9 : COPY --from=BUILD /usr/src/app/target/helloworld-jar-with-dependencies.jar /opt/app.jar
Step 7/9 : COPY --from=BUILD /usr/src/app/target/helloworld-jar-with-dependencies.jar /opt/app.jar
buildApp: buildImg error: lstat usr/src/app/target/helloworld-jar-with-dependencies.jar: no such file or directory
complete: wrote logs to /tmp/draft-logs676999161/01C93NGHNQXT03G2CH969312Q3
How can we customise the dockerfile
created by draft as it contains an error for the example-springboot
and should be
FROM maven:3.5-jdk-8 as BUILD
COPY . /usr/src/app
RUN mvn --batch-mode -f /usr/src/app/pom.xml clean package
FROM openjdk:8-jdk
ENV PORT 4567
EXPOSE 4567
COPY --from=BUILD /usr/src/app/target/demo-0.0.1-SNAPSHOT.jar /opt/app.jar
WORKDIR /opt
CMD ["java", "-jar", "app.jar"]
Hey @cmoulliard, after draft create
has been called, you should see a Dockerfile present in your local directory. You can make the changes there and commit it to source control.
If you want to customize the default packs, you can create your own custom draft pack repository.
Will either of those solutions work for you?
FYI #590 should also fix this up for you :)
When we try to build the
spring boot example
packaged under the master branch of thedraft
project on minikube 1.9, then it failsAs debug option doesn't really help and is not really verbose, how can we investigate why build is failing ?