This article mainly introduces how to specify parameter variables externally in Docker. The example code in this article is very detailed and has a certain reference value for everyone's study or work. Friends in need can refer to it. Dockerfile: FROM frolvlad/alpine-oraclejre8:slim VOLUME /tmp ADD app.jar /app.jar #COPY agent/ /usr/local/skyagent/ WORKDIR /opt COPY docker-entrypoint.sh . ENV AP_ENV=$AP_ENV EXPOSE 7015 ENV JAVA_OPTS=$JAVA_OPTS ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ] Give variables in configuration: application.properties sea=${sea123} shan=${shan123} For Test: @RestController public class WebController { @Value("${sea}") private String sea; @Value("${shan}") private String shan; @GetMapping("/sea") public String test() { return sea+shan; } } Run the image: sudo docker run -it -p 9999:9999 -e 'sea=sea_test' -e 'shan=shan_test' testproperties004 The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: A brief discussion on the pitfalls of react useEffect closure
>>: MySQL 8.0.13 manual installation tutorial
Table of contents Problem Description Principle A...
Recently, when I was working on monitoring equipm...
Achieve results Implementation Code html <h1 c...
When implementing this function, the method I bor...
First, let's take a look at the relative leng...
Use more open source tools such as docker and kub...
Website administrators often accidentally delete ...
Preface Introduction Lombok is a handy tool, just...
How to install Linux CentOS 7.7 system in Vmware,...
ERROR 1290 (HY000) : The MySQL server is running ...
Table of contents 1. Experimental Environment 2. ...
1 MySQL autocommit settings MySQL automatically c...
1. Command Introduction The date command is used ...
To beautify the table, you can set different bord...
1. Log in to VPN using IE browser 2. Remote login...