1 回答

TA貢獻(xiàn)1839條經(jīng)驗(yàn) 獲得超15個(gè)贊
我剛剛構(gòu)建了該應(yīng)用程序,它與這個(gè) Dockerfile 和 dirs 布局一起工作得很好(看看“COPY ./demo /demo/”):
FROM maven:alpine
MAINTAINER hyness <hyness@freshlegacycode.org>
EXPOSE 8888
COPY ./demo /demo/
WORKDIR /demo/
RUN mvn package
VOLUME /config
WORKDIR /
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar",\
"/demo/target/demo.jar",\
"--server.port=8888",\
"--spring.config.name=application"]
$ tree
.
├── demo
│ ├── pom.xml
│ └── src
│ └── main
│ ├── java
│ │ └── com
│ │ └── example
│ │ └── demo
│ │ └── DemoApplication.java
│ └── resources
│ └── application.properties
└── Dockerfile
添加回答
舉報(bào)