[Fixed]-Pycharm Can't retrieve image ID from build stream

6đź‘Ť

in case you follow the step above and didn’t work for you try to check if busybox:latest image if exists, else pull this again from docker hub.

Prerequisites -> the second point

5đź‘Ť

That error message usually appears when Docker is not able to build your image and tries to run it so it seem that PyCharm can connect to Docker but the build failed.

Try this:

First let’s see if PyCharm can connect to Docker (by the error you receive I think it does):

  • Open the Services window (Alt + 8)
  • Check if you can connect to “Docker” and see all the containers and images you have currently. You may need need to select “Docker” and press the play button on the left.
  • If you can’t see the “Docker” option, clic on the “+” icon in that window and try to configure a new Docker connection.

Docker connection in PyCharm – Services window

If you can see your images and containers, you’re connected to Docker. Let’s see if your build fails:

  • In the Project window (Alt + 1) right clic on your Dockerfile or Dockercompose.
  • We are going to create a Run Configuration. Select the option “Create” that has a Docker icon. If you don’t see the option it means you already have one run configuration setup for that file and instead of the “Create” option you’ll see an “Edit” option.
  • Select “Create” or “Edit” (depending on what options you see) and add the options you need for building and running your Dockerfile or Dockercompose and save the Run Configuration.
  • Now you can try and run it from the Run bar at the top right corner (select the new run configuration you just made in the drop down and press play)

Now the Services window will get focused and show the build status. If it fails, you should see the reason there.

👤Samuel O.D.

0đź‘Ť

What solved this issue for me was making sure I was logged in on Docker for Mac

👤Cody T

0đź‘Ť

Execute the following command:
docker image prune -a

-1đź‘Ť

This may also help (following https://www.jetbrains.com/help/pycharm/using-docker-as-a-remote-interpreter.html#prereq):

  • check pycharm settings > Build > Docker > Tools
  • The default docker executable was C:\Program Files\Docker\Docker\resources\bin\docker.exe (windows 10)
  • we have to select the file without .exe at the end
👤gebbissimo

-3đź‘Ť

Maybe installing docker-machine can solve this problem

👤lanxious

Leave a comment