The postgres container does not honor withCommand because it is overridden in configure():
protected void configure() {
addExposedPort(POSTGRESQL_PORT);
addEnv("POSTGRES_DB", databaseName);
addEnv("POSTGRES_USER", username);
addEnv("POSTGRES_PASSWORD", password);
setCommand("postgres");
}
This seems like it would also be a problem for several other containers using setCommand in configure, including NginxContainer, BrowserWebDriverContainer, and VncRecordingContainer.
In the case of PostgreSQLContainer, the command can just be removed, but in these other cases I'm not sure what the best behavior would be; possibly moving the default setCommand to the constructor or calling it whenever the container's internal configuration changes (e.g. when setting the vncPassword).
The postgres container does not honor
withCommandbecause it is overridden inconfigure():This seems like it would also be a problem for several other containers using
setCommandinconfigure, includingNginxContainer,BrowserWebDriverContainer, andVncRecordingContainer.In the case of
PostgreSQLContainer, the command can just be removed, but in these other cases I'm not sure what the best behavior would be; possibly moving the defaultsetCommandto the constructor or calling it whenever the container's internal configuration changes (e.g. when setting thevncPassword).