2

I'm trying to do a devcontainer setup with vscode on linux (fedora 37) but I always get the error you can see in the image link below

failed to receive status: rpc error: code = Unavailable desc = error reading from server: EOF

These are my configuration files:

Dockerfile:

FROM php:7.4-apache
RUN apt-get update && apt-get install -y \
        git \
        unzip \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
        libzip-dev \
        libicu-dev \
        libc-client-dev \
        libkrb5-dev \
        libmagickwand-dev && \
    docker-php-ext-configure gd --with-freetype --with-jpeg=/usr/include/ --enable-gd && \
    docker-php-ext-install -j$(nproc) gd && \
    docker-php-ext-configure intl && \
    PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
    docker-php-ext-install -j$(nproc) imap && \
    docker-php-ext-install zip && \
    docker-php-ext-install mysqli && \
    docker-php-ext-install pdo_mysql && \
    docker-php-ext-install intl && \
    docker-php-ext-install calendar && \
    docker-php-ext-install exif && \
    docker-php-ext-install gettext && \
    docker-php-ext-install sockets && \
    yes '' | pecl install imagick && docker-php-ext-enable imagick && \
    a2enmod rewrite && \
    a2enmod headers && \
    a2enmod cgi && \
    a2enmod proxy_fcgi && \
    apt-get remove -y libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
        libzip-dev \
        libicu-dev \
        libc-client-dev \
        libkrb5-dev \
        libmagickwand-dev && \
    apt-get clean -y

RUN sed -i -e '/.* rights="none".*pattern="PDF"/s/ rights="none"/ rights="read|write"/g' /etc/ImageMagick-6/policy.xml
COPY --from=composer:2.5 /usr/bin/composer /usr/bin/composer

devcontainer.json:

{
    "name": "PHP",
    "build": {
        "context": ".",
        "dockerfile": "Dockerfile"
    },
    "forwardPorts": [ "8000:80" ],
    "customizations": {
        "vscode": {
            "extensions": [
                "donjayamanne.git-extension-pack",
                "waderyan.gitblame",
                "ms-azuretools.vscode-docker",
                "p1c2u.docker-compose",
                "ms-vscode-remote.remote-ssh",
                "TabNine.tabnine-vscode",
                "DEVSENSE.phptools-vscode",
                "xdebug.php-pack"
            ]
        }
    },
    "workspaceMount":"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
    "workspaceFolder": "/workspace",
}

Thank you very much for the help

The information I found on the internet says that the problem is docker, but docker is fine.

I run my docker build and it finishes successfully, but devconteiner throws the error every time

1 Answer 1

2

This is most likely related to a bug in Docker stack, introduced in recent Docker 23 (check your version to make sure the below applies to you).

VSC issue: https://github.com/microsoft/vscode-remote-release/issues/7958. There you can find a workaround and links to upstream trackers that deal with the issue directly.

I can confirm the workaround of disabling BUILDKIT_INLINE_CACHE works, that is setting the following in .devcontainer.json allows for VSC to start:

{
    "build": {
        "args": {
            "BUILDKIT_INLINE_CACHE": "0"
        }
    }
}

The issue itself is supposed to be fixed already, but may not have landed in your distribution yet.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you so much!! I checked the links and verified my docker version and certanly it was 23.0.0 version, I upgraded to 23.0.1 and the problem was fixed. I was thinking the problem was related to the dev container plugin itself, never thought it was a docker bug
I have this issue with 23.0.1 as well...
That's weird - for me 23.0.1 fixed the issue as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.