-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Start container with hostname #311
Comments
Hi Rahul |
FYI this PR will make it possible to configure hostname manually: |
@bsideup yes, you're right! |
awesome, thanks! |
@rahul-swaminathan version 1.2.0 was released, you can find how to tune CreateContainerCmd in the docs now: Do you still want it implemented as |
Hi all, the CreateContainerCmd works fine with the GenericContainer (in our case we use it to set the name of the container upon creation). However I think it is not supported for the JdbcDatabaseContainers? We would like to use the CreateContainerCmd with e.g. the OracleContainer. |
Ah sorry, it is possible with a JdbcDatabaseContainer as well. Just a little bit more cumbersome. E.g.:
|
or @ClassRule
public static GenericContainer oracleContainer = new OracleContainer<>()
.withCreateContainerCmdModifier(it -> it.withName("oracle")); (note the diamond <> ) |
Hi @bsideup, I did try that but that is not possible because OracleContainer is not a parameterised type (in contrast to GenericContainer)? This code does not compile for me anyway. |
hm-hm... Does it happen if you change Sorry for that anyway, we're going to polish generics in 2.0 |
hi @bsideup, no it happens regardless of whether I use GenericContainer or OracleContainer as the variable type. No problem at all! |
@bsideup yup, we switched over to using |
Awesome! I'm closing the issue :) |
We are using GenericContainer and we need to set a specific hostname for our container. Right now, we are using
withExtraHosts
and hardcoding the ip address that the container always starts with. This creates 2 entries in/etc/hosts
with the same ip address. We'd rather have a functionwithHostName
that leveragesThe text was updated successfully, but these errors were encountered: