Where can I enable DOCKER_BUILDKIT
option in PyCharm for Docker interpreter?
I tried the following and it returns a buildkit related error1, already set configuration in Docker Desktop 2
Connecting to Docker daemon�Connected
Waiting for build operation�
Step 1/8 : FROM base/image:master
---> daee1e3e0fcb
...
Step 7/8 : RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt && chmod +x run.sh
Error response from daemon: the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled
Build completed
Unable to find an image for introspection
2
Answers
I have been struggling with the same problem, and an alternate I have found is to just build the Dockerfile using an image tag like
project-python:latest-dev
and use this image tag with thePull
option rather than theBuild
option (on the above page in your screenshot).EDIT:
I think I just figured this out.I did not figure this out…My proposed solution is for the Run/Debug configuration as used by
docker-compose
and notdocker build
.Original Answer
After you create the Docker server, create a Run/Debug configuration in your project. After you choose the Docker server, you specify the Compose files in the Run section. Click the Modify Options button and add it as an Environment variable.
Hope this works for you!