Pycharm Can't retrieve image ID from build stream

12,349

Solution 1

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.

Solution 2

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

Share:
12,349

Related videos on Youtube

nikolas
Author by

nikolas

Updated on September 26, 2022

Comments

  • nikolas
    nikolas over 1 year

    Want to connect pycharm docker interpreter. Here is my windows docker status

    docker windows

    and here is pycharm status

    how can I fix the issue

    pycharm

  • Itzhak Galitch
    Itzhak Galitch over 3 years
    I had the same issue, but my docker-compose doesn't fail. And I have no idea why I got "Can't retrieve image ID from build stream".
  • Youwei Liang
    Youwei Liang over 2 years
    It seemed that my PyCharm didn't work with docker due to Internet connection issue. I finially resolved the problem by manually pulling busybox from a docker mirror that my machine could access.