如何设置Testcontainers的属性

huangapple go评论37阅读模式
英文:

How to set up property for testcontainers

问题

ryuk.container.image 设置为私有注册表镜像。我尝试了以下方法:

  • -Dryuk.container.image
  • -DRYUK_CONTAINER_IMAGE
  • -DTESTCONTAINER_RYUK_CONTAINER_IMAGE

但都没有成功。

当我创建自定义的 testcontainers.properties 文件并添加 ryuk.container.image=ryuk.image:3.0.3 时,它被识别,但当我注入 Maven 属性时,它不被替代:

ryuk.container.image=${my.property} - 不起作用

我如何可以将 ryuk.container.image 指定为 -D 命令或使用 Maven 属性替代它?

英文:

I want to set up ryuk.container.image as a private registry image. What I tried:

  • -Dryuk.container.image
  • -DRYUK_CONTAINER_IMAGE
  • -DTESTCONTAINER_RYUK_CONTAINER_IMAGE

Without success.

When I create custom testcontainers.properties and add: ryuk.container.image=ryuk.image:3.0.3 it being picked up, but when I inject maven property there It does not substitute it:

ryuk.container.image=${my.property} - not working

How I can specify ryuk.container.image as -D command or substitute it with maven property?

答案1

得分: 3

Use export TESTCONTAINERS_RYUK_CONTAINER_IMAGE=testcontainers/ryuk:0.4.0 作为一个环境变量。 -D 允许定义一个系统属性,但不被考虑。

了解更多信息,请参阅这里

英文:

Use export TESTCONTAINERS_RYUK_CONTAINER_IMAGE=testcontainers/ryuk:0.4.0 as an environment variable. -D it allows to define a system property which is not taken into account.

Read more here.

huangapple
  • 本文由 发表于 2023年4月1日 00:55:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/75900962.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定