简体   繁体   English

如何在 docker 中为 maven 插件添加 Jasypt 解密密钥

[英]How to add Jasypt decryption key for maven plugin in docker

I have a Spring Boot project with Jasypt with maven plugin.我有一个带有 Jasypt 和 maven 插件的 Spring 引导项目。 Now the server has a Jenkins pipeline that builds a docker image and then runs.现在服务器有一个 Jenkins 管道,它构建一个 docker 映像然后运行。

I can run the encryption locally with maven like this:我可以使用 maven 在本地运行加密,如下所示:

mvn spring-boot:run -Dspring-boot.run.profiles=dev -Dspring-boot.run.jvmArguments=-Djasypt.encryptor.password=password

My question is, how do I add the jasypt encryption key in docker?我的问题是,如何在 docker 中添加 jasypt 加密密钥? Can I add it to the entrypoint or should the key be set somewhere else?我可以将它添加到入口点还是应该将密钥设置在其他地方?

I'm a junior developer with no previous experience with DevOps and didn't set up the original pipeline, so please let me know if this should be achieved in some other way.我是一名初级开发人员,以前没有 DevOps 经验,也没有设置原始管道,所以请告诉我是否应该以其他方式实现。

ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=staging", "/app.jar"]

ENTRYPOINT./mvnw spring-boot:run -Dspring-boot.run.jvmArguments=-Djasypt.encryptor.password=$JASYPT_KEY ENTRYPOINT./mvnw spring-boot:run -Dspring-boot.run.jvmArguments=-Djasypt.encryptor.password=$JASYPT_KEY

Where $JASYPT_KEY is an environment variable其中 $JASYPT_KEY 是环境变量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM