最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

docker - Dev Container - Setting up container error - Stack Overflow

programmeradmin1浏览0评论

this is the error: .png

I've been trying to set up a container in my project. I am new in creating containers and I don't know much about them. I've searched for a lot of questions and other docker hub information but I could not solve the problem.

This is my Dockerfile:

FROM python:3.11-buster

LABEL description="Remote Containers for tutorials"
LABEL version="1.0"

COPY requirements.txt ./

RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt

ENV PYTHONPATH "/"
WORKDIR .

And this is the error log:

[2025-01-29T13:33:12.275Z] Command failed: C:\Users\orkan\AppData\Local\Programs\Microsoft VS Code\Code.exe c:\Users\orkan\.vscode\extensions\ms-vscode-remote.remote-containers-0.394.0\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\orkan\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --container-session-data-folder /tmp/devcontainers-39a19f6b-588b-4226-bd27-eccb38782c291738157583495 --workspace-folder c:\Users\orkan\Documents\hypnoteizer\Astrophysics\Setup - VSCode --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=c:\Users\orkan\Documents\hypnoteizer\Astrophysics\Setup - VSCode --id-label devcontainer.config_file=c:\Users\orkan\Documents\hypnoteizer\Astrophysics\Setup - VSCode\.devcontainer\devcontainer.json --log-level debug --log-format json --config c:\Users\orkan\Documents\hypnoteizer\Astrophysics\Setup - VSCode\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root --include-configuration --include-merged-configuration

I tried to copy directly from the repo of the tutorial, but it didn't fix the problem. The tutorial uses python3.9 but I currently have 3.11 . I dont think this is a problem but I wanted to mention. He uses python:3.9-buster so I used 3.11-buster .

this is the error: https://i.sstatic/rEMivHsk.png

I've been trying to set up a container in my project. I am new in creating containers and I don't know much about them. I've searched for a lot of questions and other docker hub information but I could not solve the problem.

This is my Dockerfile:

FROM python:3.11-buster

LABEL description="Remote Containers for tutorials"
LABEL version="1.0"

COPY requirements.txt ./

RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt

ENV PYTHONPATH "/"
WORKDIR .

And this is the error log:

[2025-01-29T13:33:12.275Z] Command failed: C:\Users\orkan\AppData\Local\Programs\Microsoft VS Code\Code.exe c:\Users\orkan\.vscode\extensions\ms-vscode-remote.remote-containers-0.394.0\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\orkan\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --container-session-data-folder /tmp/devcontainers-39a19f6b-588b-4226-bd27-eccb38782c291738157583495 --workspace-folder c:\Users\orkan\Documents\hypnoteizer\Astrophysics\Setup - VSCode --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=c:\Users\orkan\Documents\hypnoteizer\Astrophysics\Setup - VSCode --id-label devcontainer.config_file=c:\Users\orkan\Documents\hypnoteizer\Astrophysics\Setup - VSCode\.devcontainer\devcontainer.json --log-level debug --log-format json --config c:\Users\orkan\Documents\hypnoteizer\Astrophysics\Setup - VSCode\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root --include-configuration --include-merged-configuration

I tried to copy directly from the repo of the tutorial, but it didn't fix the problem. The tutorial uses python3.9 but I currently have 3.11 . I dont think this is a problem but I wanted to mention. He uses python:3.9-buster so I used 3.11-buster .

Share Improve this question edited Jan 29 at 13:51 hypno asked Jan 29 at 13:24 hypnohypno 12 bronze badges 7
  • Firstly, The image you've shared does not show the error. Please share more about what is the error you are facing. Secondly, while the container configuration you've shared are correct. Try removing lines from it to see if things start to work. (I say this because it seems you're on windows system and I'm assuming something like WORKDIR . might not work on windows.) Thirdly, I see you're using vscode to built the image. Please share the configuration of that as well. Currently, you have not shared enough data for someone to be able to help you. – atb00ker Commented Jan 29 at 13:31
  • @atb00ker is it okay now? I do not know much about the images and the files you mentioned. – hypno Commented Jan 29 at 13:41
  • What do you mean by "this is the error"? Can you share the full and exact error message, along with your attempts to resolve the error? – Nico Haase Commented Jan 29 at 13:42
  • @NicoHaase ive added a photo of the error and I tried to add image command in devcontainer.json file that was built. – hypno Commented Jan 29 at 13:45
  • 1 Please don't add photos of text content – Nico Haase Commented Jan 29 at 13:47
 |  Show 2 more comments

1 Answer 1

Reset to default 0

If looking correctly, I know this line you have: ENV PYTHONPATH "/"

usually the syntax for it is: ENV <key>=<value> or for an example: ENV PythonPath="/" if not that WORKDIR is definitely suspicious with using VS code. Is this on Windows? See if you can't remove the image and try rebuilding this. If that doesn't work, try commenting out the pip install line, remove the image, and make a fresh one and try the build again and show us the error.

could just be something with syntax or a bad image build.

发布评论

评论列表(0)

  1. 暂无评论