Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LMP 3.9 devc mode -DdockerRunOpts does not work #1740

Closed
gkwan-ibm opened this issue Oct 17, 2023 · 5 comments · Fixed by #1751
Closed

LMP 3.9 devc mode -DdockerRunOpts does not work #1740

gkwan-ibm opened this issue Oct 17, 2023 · 5 comments · Fixed by #1751
Assignees
Labels

Comments

@gkwan-ibm
Copy link
Member

gkwan-ibm commented Oct 17, 2023

-DdockerRunOpts does not work

Scenario 1:

  • used LMP 3.9 and Colima Docker on Mac
  • run mvn liberty:devc -DdockerRunOpts="-e DB_HOSTNAME=172.17.0.2" -DserverStartTimeout=240
  • run docker exec -it liberty-dev env | grep DB_HOSTNAME
  • return nothing
    • expected same as Scenario 2

Scenario 2:

  • used LMP 3.8.2 and Colima Docker on Mac
  • run mvn liberty:devc -DdockerRunOpts="-e DB_HOSTNAME=172.17.0.2" -DserverStartTimeout=240
    • run 3 times for a known issue
  • run docker exec -it liberty-dev env | grep DB_HOSTNAME
  • return DB_HOSTNAME=172.17.0.2
@gkwan-ibm
Copy link
Member Author

gkwan-ibm commented Oct 17, 2023

It blocked the new guide https://github.com/OpenLiberty/draft-guide-testcontainers.

@cherylking
Copy link
Member

@gkwan-ibm Hi Gilbert, can you try containerRunOpts instead to make progress?

We replaced dockerRunOpts with containerRunOpts, but intended to preserve being able to specify dockerRunOpts. I think it works if you specify it in the pom.xml, but maybe not as a property from the command line. I can fix that in the next release so both work from the command line.

@cherylking cherylking added the bug label Oct 17, 2023
@gkwan-ibm
Copy link
Member Author

-DcontainerRunOpts works, thanks

BTW, Rancher Desktop has the same issue.

@cherylking
Copy link
Member

@gkwan-ibm I'm glad containerRunOpts works. By the way, our plugins have no awareness of whether you are using Colima or Rancher Desktop or whatever else. This is just a plugin configuration parameter that we modified to be more generic instead of Docker specific.

@scottkurz
Copy link
Member

Noting that we didn't carry forward the "property" config in the past in the case of 'serverEnvFile' replacing 'serverEnv'.
So you can only do -DserverEnvFile not -DserverEnv now.

Not saying we are completely bound by that decision. If we want to support both properties we have to flag as an error or define our own precedence between them since I'm not sure how to have Maven do that for us. I think an error would be OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants