Passing parameters in docker-compose and into POM

  docker, docker-compose, dockerfile, java, maven

I know there is a way to pass parameters in maven through the POM.

POM MAVEN

<properties>
    <webproperty> ${webproperty} </webproperty>
</properties>

COMMAND LINE WITH MAVEN

mvn install "-Dwebproperty=chrome"

I recently switched over to Docker and I was wondering if there was still a way to pass the parameters through the POM? I was looking at some examples and was wondering if I was going about it the right way.

Docker YAML

 build:
    image: something/webtest 
    environment:
     - HUB_HOST=hub
    browser:
     - BROWSER=${BROWSER_TYPE}

COMMAND LINE WITH DOCKER

docker-compose up BROWSER_TYPE=chrome

Also will this command still work.

System.getProperty("BROWSER_TYPE");

Thanks in advance!

Source: Docker Questions

LEAVE A COMMENT