Some devcontainer images don't work in IntelliJ

Answered

I have a devcontainer working in VSCode, but I can't get the same image to work with an IntelliJ IDE. I tried checking the system requirements, and I think the image meets them. Are there other things needed in an image to be used as a devcontainer in IntelliJ?

I've tried in both PyCharm 2023.2.1 Pro and IntelliJ IDEA 2023.2.1 Ultimate. I'm trying to use the mcr.microsoft.com/devcontainers/universal:2-linux image, because it doesn't count as storage space in GitHub codespaces. When I try it with the openjdk:11 image, it works.

Here's the display when I try to create a dev container:

Deploying 'Dev Container'…
Creating container…
Container Id: 137057385eae5fd7eeb5fa53f3c47248f481a9095ad8ad31d840adb78a92dd1f
Container name: '/suspicious_galileo'
Starting container '/suspicious_galileo'
'Dev Container' has been deployed successfully.
Preparing environment...
Environment is successfully prepared...
Status 409: {"message":"Container 137057385eae5fd7eeb5fa53f3c47248f481a9095ad8ad31d840adb78a92dd1f is not running"}

Here's the full devcontainer.json:

{
    "name": "udjango",
    "image": "mcr.microsoft.com/devcontainers/universal:2-linux"
}

 

0
5 comments

Hello, Don Kirkby. The error you mentioned looks related to this issue; however, I couldn't run the Docker container using the image you mentioned. 

Could you please first try to start the ordinary Docker container and check if it works? If it works fine, please create a separate image using the following Dockerfile and try to run the DevContainer using this image.

FROM mcr.microsoft.com/devcontainers/universal:2-linux

RUN apt-get update && apt-get install -y curl wget unzip tar gzip

0

Looks like the problem was the entrypoint in that image. When I overrode it with bash in a Dockerfile, the image worked fine for PyCharm and IDEA.

0

Thank you for the update; I'm glad you solved the problem. 
Please, feel free to contact us in case of any questions or requests.

0

I"m also seeing this problem.  how did you end up changing your entrypoint so it worked? Don Kirkby 

i'm currently using ENTRYPOINT ["/bin/bash"]

0

Here's the full Dockerfile, Savan:

FROM mcr.microsoft.com/devcontainers/universal:2-linux

RUN python -m pip install pipenv && \
    printf "export PIPENV_SHELL=bash\npipenv shell" >/home/codespace/.python/current/bin/pipenv-shell && \
    chmod +x /home/codespace/.python/current/bin/pipenv-shell

ENTRYPOINT bash
0

Please sign in to leave a comment.