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