0

I have a spring boot app dockerised named monitormaster I need to connect to another container host to do some manipulation on it like restart , stop , start ...

I have problem in docker api with the host (" maybe " ).

This is my docker file :

enter image description here

and this my code :

enter image description here

PS : i'm using a default network bridge on windonws containing two container , the spring boot container named monitormaster and another container X that i need to make on it some manipulation through ws , when i inspect the host of container X it's '172.24.0.2'(i'm using docker on windows) . but it throw route not reachable and with host.docker.internal as it is in the screen shot the exception is : com.github.dockerjava.api.exception.NotFoundException: {"timestamp":"2022-03-20T02:24:00.723+00:00","status":404,"error":"Not Found","path":"/containers/json"}

please anyone help me how to make a correct docker config with the correct host and how to get the host of a container from another container .

thank you all!

  • You seem to have attached two image files to the question in place of your code. Can you [edit] the question and replace those images with the text of your Dockerfile and Java code? – David Maze Mar 20 '22 at 11:08
  • (If you have access to the host's Docker socket to do the operations you describe, I'm not sure why the network details you talk about should matter. Also, if you have access to the host's Docker socket, you can fairly trivially root the entire host; do you _really_ need to perform this operation from this application?) – David Maze Mar 20 '22 at 11:10

0 Answers0