0

I'm using the docker-java libraries to handle start up of a Docker image:

DockerClient dockerClient = DockerClientBuilder.getInstance("unix:///var/run/docker.sock").build(); 
CreateContainerResponse container = dockerClient.createContainerCmd("postgres")
                .withCmd("--bind_ip_all")
                .withHostName("127.0.0.1")
                .withPortBindings(PortBinding.parse("5432:5432")).exec();

dockerClient.startContainerCmd(container.getId()).exec();

I can see I'm able to return the containerId from the above command

  String containerId = container.getId();

However running a 'docker ps' shows an empty list. Do I miss something in order to start the postgres container image? Thanks

Francesco Marchioni
  • 4,091
  • 1
  • 25
  • 40

1 Answers1

0

I've just relalized that the cause is the

 .withCmd("--bind_ip_all")

It seems to conflict with my docker configuration. By removing that line I'm able to see the Container with 'docker ps'

Francesco Marchioni
  • 4,091
  • 1
  • 25
  • 40