admin管理员组

文章数量:1416050

I'm trying to configure my Quarkus application to map a volume during the test phase.

    datasource:
        devservices:
            enabled: true
            volumes:
                ${INIT_SQL_SCRIPTS_PATH}: /container-entrypoint-initdb.d

The ${INIT_SQL_SCRIPTS_PATH} property is defined in two places:

  • in a maven profile activated for the Windows OS
  • in Jenkins, as an environment property

Unfortunately, even if I see that the property is found (I ran mvn -X and the logs mention it), it's not injected in the volume mapping. The error that I see is:

2025-02-03 09:17:24,799 ERROR [tc.doc.io/gvenzl/oracle-free:23-slim-faststart] (build-61) Could not start container: com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"invalid volume specification: 'C:\my_app\${INIT_SQL_SCRIPTS_PATH}:/container-entrypoint-initdb.d:rw,z'"}

Any suggestion ?

I'm trying to configure my Quarkus application to map a volume during the test phase.

    datasource:
        devservices:
            enabled: true
            volumes:
                ${INIT_SQL_SCRIPTS_PATH}: /container-entrypoint-initdb.d

The ${INIT_SQL_SCRIPTS_PATH} property is defined in two places:

  • in a maven profile activated for the Windows OS
  • in Jenkins, as an environment property

Unfortunately, even if I see that the property is found (I ran mvn -X and the logs mention it), it's not injected in the volume mapping. The error that I see is:

2025-02-03 09:17:24,799 ERROR [tc.doc.io/gvenzl/oracle-free:23-slim-faststart] (build-61) Could not start container: com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"invalid volume specification: 'C:\my_app\${INIT_SQL_SCRIPTS_PATH}:/container-entrypoint-initdb.d:rw,z'"}

Any suggestion ?

Share Improve this question asked Feb 3 at 9:18 IonutIonut 1
Add a comment  | 

1 Answer 1

Reset to default 0

Quarkus doesn't replace the keys, only the values. My workaround was to use the resources plugin to replace the INIT_SQL_SCRIPTS_PATH placeholder with the proper path, depending on the environment.

本文标签: testcontainersQuarkus dynamic keysIs it possibleStack Overflow