【发布时间】:2019-03-15 02:43:03
【问题描述】:
我正在使用 dockerized 镜像在 AWS ECS 容器上运行。
码头文件:
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
EXPOSE 8080
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=${profile}","-jar","/app.jar"]`
我可以在我的 Spring Boot 类中获取这个变量吗?
想用它在我的 Spring Boot 应用程序中设置配置文件。
【问题讨论】:
-
请发布您的 Dockerfile、运行容器的命令行、spring-boot 版本等。这里的信息太少。一些阅读:How to create a Minimal, Complete, and Verifiable example
-
是的,可以,有什么问题吗?
-
任何参考或示例如何?
标签: amazon-web-services docker spring-boot environment-variables