microsoft / vscode-dev-containers

NOTE: Most of the contents of this repository have been migrated to the new devcontainers GitHub org (https://github.com/devcontainers). See https://github.com/devcontainers/template-starter and https://github.com/devcontainers/feature-starter for information on creating your own!
https://aka.ms/vscode-remote
MIT License
4.72k stars 1.4k forks source link

VScode devcontainer build script calls image by wrong name #1567

Closed OmarOmeiri closed 2 years ago

OmarOmeiri commented 2 years ago

Container build breaks with:

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
[2022-08-05T18:46:41.105Z] Stop (2005 ms): Run: docker-compose --project-name lullo_devcontainer -f /home/omar/Lullo/.devcontainer/docker-compose.yml build
# HERE #
[2022-08-05T18:46:41.105Z] Start: Run: docker inspect --type image lullo_devcontainer_workspace
# HERE #
[2022-08-05T18:46:41.188Z] Stop (83 ms): Run: docker inspect --type image lullo_devcontainer_workspace
# HERE #
[2022-08-05T18:46:41.189Z] Start: Run: docker pull lullo_devcontainer_workspace
[2022-08-05T18:46:41.266Z] Using default tag: latest
[2022-08-05T18:46:43.879Z] Error response from daemon: pull access denied for lullo_devcontainer_workspace, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
# HERE #
[2022-08-05T18:46:43.881Z] Stop (2692 ms): Run: docker pull lullo_devcontainer_workspace
[2022-08-05T18:46:43.881Z] []
[2022-08-05T18:46:43.881Z] Error: No such image: lullo_devcontainer_workspace

[2022-08-05T18:46:43.880Z] Error: Command failed: docker inspect --type image lullo_devcontainer_workspace
[2022-08-05T18:46:43.880Z]     at eS (/home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js:203:2698)
[2022-08-05T18:46:43.880Z]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-08-05T18:46:43.880Z]     at async ES (/home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js:260:2177)
[2022-08-05T18:46:43.880Z]     at async no (/home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js:260:3110)
[2022-08-05T18:46:43.880Z]     at async rP (/home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js:353:8748)
[2022-08-05T18:46:43.880Z]     at async nP (/home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js:353:8504)
[2022-08-05T18:46:43.882Z] Stop (5268 ms): Run in Host: /home/omar/.vscode-server-insiders/bin/73fd3f11032e7b83c2ae011b5516e6ddd19e3db2/node /home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/omar/Lullo --workspace-mount-consistency cached --id-label devcontainer.local_folder=\\wsl.localhost\Ubuntu-20.04\home\omar\Lullo --log-level debug --log-format json --config /home/omar/Lullo/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-08-05T18:46:43.882Z] Exit code 1
[2022-08-05T18:46:43.885Z] Command failed: /home/omar/.vscode-server-insiders/bin/73fd3f11032e7b83c2ae011b5516e6ddd19e3db2/node /home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/omar/Lullo --workspace-mount-consistency cached --id-label devcontainer.local_folder=\\wsl.localhost\Ubuntu-20.04\home\omar\Lullo --log-level debug --log-format json --config /home/omar/Lullo/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-08-05T18:46:43.885Z] Exit code 1

The image is created successfully, but the script is calling pull and inspect with the wrong image name. If I run docker image ls I get:

REPOSITORY                     TAG       IMAGE ID       CREATED          SIZE
lullo_devcontainer-workspace   latest    690d647e7962   20 minutes ago   931MB

So the image is being created with this name: lullo_devcontainer-workspace But the script calls: lullo_devcontainer_workspace Replaces "-" with "_"

Steps to Reproduce:

  1. docker-compose.yml
    version: '3'
    services:
    # Update this to the name of the service you want to work with in your docker-compose.yml file
    workspace:
    user: lullo-user
    build: ../
    volumes:
      - ..:/home/lullo-user/Lullo:cached
      - vscode-volume:/home/lullo-user/.vscode-server/extensions:cached
      - vscode-insiders-volume:/home/lullo-user/.vscode-server-insiders/extensions:cached
    environment:
      - USER=lullo-user
    command: tail -f /dev/null   # stopping container takes about 10 sec.
    tty: true 
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
    vscode-volume:
    vscode-insiders-volume:
  2. devcontainer.json
    
    {
    "name": "Existing Docker Compose (Extend)",
    "dockerComposeFile": [
     "docker-compose.yml"
    ],
    "service": "workspace",
    "workspaceFolder": "/home/lullo-user/Lullo",
    "settings": {
      "terminal.integrated.defaultProfile.linux": "bash",
      "typescript.tsdk": "/home/lullo-user/.npm/lib/node_modules/typescript/lib",
      "getTsdkPath": "`echo \"$(npm root -g)/typescript/lib\"`",
      "terminal.integrated.profiles.linux": {
      "bash": {
        "path": "bash"
      }
    },
    "relativePath.ignore": [
      "**/node_modules/**"
    ],
    "relativePath.extendedLimit": 3000,
    "r.lsp.enabled": true,
    "r.rpath.linux": "/usr/bin/R",
    "r.lsp.debug": true,
    "r.lsp.diagnostics": true,
    "r.bracketedPaste": true,
    "r.rterm.linux": "/usr/local/bin/radian",
    "r.plot.useHttpgd": true,
    "r.session.data.rowLimit": 500,
    "r.session.levelOfObjectDetail": "Normal",
    "[r]": {
      "editor.formatOnSave": true
    }
    },
    "extensions": [
    "ms-azuretools.vscode-docker",
    "ms-vscode-remote.remote-containers",
    "ms-vscode-remote.remote-wsl",
    "janisdd.vscode-edit-csv",
    "reditorsupport.r",
    "rdebugger.r-debugger"
    ],
    "postCreateCommand": ["/bin/bash", "-l", "-c", "find . -type f -name \"*.lullo\" -print0 | xargs -0 chmod +x && ~/.lullo/set-up.lullo"],
    "remoteUser": "lullo-user",
    "shutdownAction": "stopCompose"
    }
3. `Ctrl + Shift + P` -> Remote-Containers: Rebuild and Reopen in Container

<details>
  <summary>Full Logs for reference:</summary>

```sh
[2022-08-05T18:57:38.540Z] Remote-Containers 0.243.0 in VS Code 1.71.0-insider (73fd3f11032e7b83c2ae011b5516e6ddd19e3db2).
[2022-08-05T18:57:38.540Z] Start: Run: wsl -d Ubuntu-20.04 -e wslpath -u \\wsl.localhost\Ubuntu-20.04\home\omar\Lullo
[2022-08-05T18:57:39.000Z] Stop (460 ms): Run: wsl -d Ubuntu-20.04 -e wslpath -u \\wsl.localhost\Ubuntu-20.04\home\omar\Lullo
[2022-08-05T18:57:39.008Z] Start: Resolving Remote
[2022-08-05T18:57:39.018Z] Start: Run: wsl -d Ubuntu-20.04 -e wslpath -u \\wsl.localhost\Ubuntu-20.04\home\omar\Lullo
[2022-08-05T18:57:39.161Z] Stop (143 ms): Run: wsl -d Ubuntu-20.04 -e wslpath -u \\wsl.localhost\Ubuntu-20.04\home\omar\Lullo
[2022-08-05T18:57:39.162Z] Start: Run: wsl -d Ubuntu-20.04 -e /bin/sh -c cd '/home/omar/Lullo' && /bin/sh
[2022-08-05T18:57:39.170Z] Start: Run in host: id -un
[2022-08-05T18:57:39.248Z] omar
[2022-08-05T18:57:39.249Z] 
[2022-08-05T18:57:39.249Z] Stop (79 ms): Run in host: id -un
[2022-08-05T18:57:39.249Z] Start: Run in host: cat /etc/passwd
[2022-08-05T18:57:39.250Z] Stop (1 ms): Run in host: cat /etc/passwd
[2022-08-05T18:57:39.250Z] Start: Run in host: echo ~
[2022-08-05T18:57:39.251Z] /home/omar
[2022-08-05T18:57:39.251Z] 
[2022-08-05T18:57:39.251Z] Stop (1 ms): Run in host: echo ~
[2022-08-05T18:57:39.251Z] Start: Run in host: test -x '/home/omar/.vscode-remote-containers/bin/73fd3f11032e7b83c2ae011b5516e6ddd19e3db2/node'
[2022-08-05T18:57:39.252Z] 
[2022-08-05T18:57:39.252Z] 
[2022-08-05T18:57:39.252Z] Exit code 1
[2022-08-05T18:57:39.252Z] Stop (1 ms): Run in host: test -x '/home/omar/.vscode-remote-containers/bin/73fd3f11032e7b83c2ae011b5516e6ddd19e3db2/node'
[2022-08-05T18:57:39.253Z] Start: Run in host: test -x '/home/omar/.vscode-server-insiders/bin/73fd3f11032e7b83c2ae011b5516e6ddd19e3db2/node'
[2022-08-05T18:57:39.253Z] 
[2022-08-05T18:57:39.254Z] 
[2022-08-05T18:57:39.254Z] Stop (1 ms): Run in host: test -x '/home/omar/.vscode-server-insiders/bin/73fd3f11032e7b83c2ae011b5516e6ddd19e3db2/node'
[2022-08-05T18:57:39.254Z] Start: Run in host: test -f '/home/omar/.vscode-server-insiders/bin/73fd3f11032e7b83c2ae011b5516e6ddd19e3db2/node_modules/node-pty/package.json'
[2022-08-05T18:57:39.254Z] 
[2022-08-05T18:57:39.255Z] 
[2022-08-05T18:57:39.255Z] Stop (1 ms): Run in host: test -f '/home/omar/.vscode-server-insiders/bin/73fd3f11032e7b83c2ae011b5516e6ddd19e3db2/node_modules/node-pty/package.json'
[2022-08-05T18:57:39.255Z] Start: Run in host: test -f '/home/omar/.vscode-remote-containers/dist/vscode-remote-containers-server-0.243.0.js'
[2022-08-05T18:57:39.255Z] 
[2022-08-05T18:57:39.256Z] 
[2022-08-05T18:57:39.256Z] Stop (1 ms): Run in host: test -f '/home/omar/.vscode-remote-containers/dist/vscode-remote-containers-server-0.243.0.js'
[2022-08-05T18:57:39.257Z] userEnvProbe: loginInteractiveShell (default)
[2022-08-05T18:57:39.258Z] userEnvProbe shell: /bin/bash
[2022-08-05T18:57:39.495Z] userEnvProbe PATHs:
Probe:     '/home/omar/.nvm/versions/node/v16.16.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Python310/Scripts/:/mnt/c/Python310/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/nodejs/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Users/omaro/PATH:/mnt/c/Users/omaro/AppData/Local/Programs/Microsoft VS Code Insiders/bin:/mnt/c/Users/omaro/AppData/Roaming/npm:/snap/bin'
Container: None
[2022-08-05T18:57:39.496Z] Setting up container for folder or workspace: /home/omar/Lullo
[2022-08-05T18:57:39.496Z] Host: unix:///mnt/wsl/shared-docker/docker.sock
[2022-08-05T18:57:39.513Z] Start: Check Docker is running
[2022-08-05T18:57:39.514Z] Start: Run in Host: docker version --format {{.Server.APIVersion}}
[2022-08-05T18:57:39.586Z] Stop (72 ms): Run in Host: docker version --format {{.Server.APIVersion}}
[2022-08-05T18:57:39.586Z] Server API version: 1.41
[2022-08-05T18:57:39.586Z] Stop (73 ms): Check Docker is running
[2022-08-05T18:57:39.587Z] Start: Run in Host: docker volume ls -q
[2022-08-05T18:57:39.655Z] Stop (68 ms): Run in Host: docker volume ls -q
[2022-08-05T18:57:39.661Z] Start: Run in Host: docker ps -q -a --filter label=vsch.local.folder=\\wsl.localhost\Ubuntu-20.04\home\omar\Lullo --filter label=vsch.quality=insider
[2022-08-05T18:57:39.722Z] Stop (61 ms): Run in Host: docker ps -q -a --filter label=vsch.local.folder=\\wsl.localhost\Ubuntu-20.04\home\omar\Lullo --filter label=vsch.quality=insider
[2022-08-05T18:57:39.726Z] Start: Run in Host: /home/omar/.vscode-server-insiders/bin/73fd3f11032e7b83c2ae011b5516e6ddd19e3db2/node /home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/omar/Lullo --workspace-mount-consistency cached --id-label devcontainer.local_folder=\\wsl.localhost\Ubuntu-20.04\home\omar\Lullo --log-level debug --log-format json --config /home/omar/Lullo/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-08-05T18:57:39.800Z] remote-containers 0.243.0.
[2022-08-05T18:57:39.800Z] Start: Run: docker buildx version
[2022-08-05T18:57:39.941Z] Stop (141 ms): Run: docker buildx version
[2022-08-05T18:57:39.941Z] Start: Resolving Remote
[2022-08-05T18:57:39.945Z] Start: Run: docker-compose version --short
[2022-08-05T18:57:39.958Z] Stop (13 ms): Run: docker-compose version --short
[2022-08-05T18:57:39.959Z] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=lullo_devcontainer --filter label=com.docker.compose.service=workspace
[2022-08-05T18:57:40.021Z] Stop (62 ms): Run: docker ps -q -a --filter label=com.docker.compose.project=lullo_devcontainer --filter label=com.docker.compose.service=workspace
[2022-08-05T18:57:40.022Z] Start: Run: docker-compose -f /home/omar/Lullo/.devcontainer/docker-compose.yml --profile * config
[2022-08-05T18:57:40.081Z] Stop (59 ms): Run: docker-compose -f /home/omar/Lullo/.devcontainer/docker-compose.yml --profile * config
[2022-08-05T18:57:40.082Z] name: devcontainer
services:
  workspace:
    build:
      context: /home/omar/Lullo
      dockerfile: Dockerfile
    command:
    - tail
    - -f
    - /dev/null
    environment:
      USER: lullo-user
    extra_hosts:
      host.docker.internal: host-gateway
    networks:
      default: null
    tty: true
    user: lullo-user
    volumes:
    - type: bind
      source: /home/omar/Lullo
      target: /home/lullo-user/Lullo
      bind:
        create_host_path: true
    - type: volume
      source: vscode-volume
      target: /home/lullo-user/.vscode-server/extensions
      volume: {}
    - type: volume
      source: vscode-insiders-volume
      target: /home/lullo-user/.vscode-server-insiders/extensions
      volume: {}
networks:
  default:
    name: devcontainer_default
volumes:
  vscode-insiders-volume:
    name: devcontainer_vscode-insiders-volume
  vscode-volume:
    name: devcontainer_vscode-volume
[2022-08-05T18:57:40.084Z] Start: Run: docker -v
[2022-08-05T18:57:40.144Z] Stop (60 ms): Run: docker -v
[2022-08-05T18:57:40.144Z] Start: Run: docker events --format {{json .}} --filter event=start
[2022-08-05T18:57:40.146Z] PersistedPath=/tmp, ContainerHasLabels=false
[2022-08-05T18:57:40.146Z] Start: Run: docker-compose -f /home/omar/Lullo/.devcontainer/docker-compose.yml --profile * config
[2022-08-05T18:57:40.194Z] Stop (48 ms): Run: docker-compose -f /home/omar/Lullo/.devcontainer/docker-compose.yml --profile * config
[2022-08-05T18:57:40.195Z] name: devcontainer
services:
  workspace:
    build:
      context: /home/omar/Lullo
      dockerfile: Dockerfile
    command:
    - tail
    - -f
    - /dev/null
    environment:
      USER: lullo-user
    extra_hosts:
      host.docker.internal: host-gateway
    networks:
      default: null
    tty: true
    user: lullo-user
    volumes:
    - type: bind
      source: /home/omar/Lullo
      target: /home/lullo-user/Lullo
      bind:
        create_host_path: true
    - type: volume
      source: vscode-volume
      target: /home/lullo-user/.vscode-server/extensions
      volume: {}
    - type: volume
      source: vscode-insiders-volume
      target: /home/lullo-user/.vscode-server-insiders/extensions
      volume: {}
networks:
  default:
    name: devcontainer_default
volumes:
  vscode-insiders-volume:
    name: devcontainer_vscode-insiders-volume
  vscode-volume:
    name: devcontainer_vscode-volume
[2022-08-05T18:57:40.197Z] local container features stored at: /home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/node_modules/vscode-dev-containers/container-features
[2022-08-05T18:57:40.198Z] Start: Run: tar --no-same-owner -x -f -
[2022-08-05T18:57:40.218Z] Stop (20 ms): Run: tar --no-same-owner -x -f -
[2022-08-05T18:57:40.218Z] Start: Run: docker-compose --project-name lullo_devcontainer -f /home/omar/Lullo/.devcontainer/docker-compose.yml build
[2022-08-05T18:57:40.379Z] [+] Building 0.0s (0/1)                                                         
[2022-08-05T18:57:40.484Z] [+] Building 0.1s (2/3)                                                         
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 32B                                        0.0s
 => [internal] load .dockerignore                                          0.1s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/node:16.13.0            0.0s
[2022-08-05T18:57:40.484Z] 
[2022-08-05T18:57:40.634Z] [+] Building 0.3s (2/3)                                                         
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 32B                                        0.0s
 => [internal] load .dockerignore                                          0.1s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/node:16.13.0            0.2s
[2022-08-05T18:57:40.785Z] [+] Building 0.4s (2/3)                                                         
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 32B                                        0.0s
[2022-08-05T18:57:40.785Z]  => [internal] load .dockerignore                                          0.1s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/node:16.13.0            0.3s
[2022-08-05T18:57:40.936Z] [+] Building 0.6s (2/3)                                                         
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 32B                                        0.0s
 => [internal] load .dockerignore                                          0.1s
 => => transferring context: 2B                                            0.0s
[2022-08-05T18:57:40.936Z]  => [internal] load metadata for docker.io/library/node:16.13.0            0.5s
[2022-08-05T18:57:41.087Z] [+] Building 0.7s (2/3)                                                         
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 32B                                        0.0s
[2022-08-05T18:57:41.087Z]  => [internal] load .dockerignore                                          0.1s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/node:16.13.0            0.6s
[2022-08-05T18:57:41.237Z] [+] Building 0.9s (2/3)                                                         
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 32B                                        0.0s
[2022-08-05T18:57:41.238Z]  => [internal] load .dockerignore                                          0.1s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/node:16.13.0            0.8s
[2022-08-05T18:57:41.388Z] [+] Building 1.0s (14/15)                                                       
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 32B                                        0.0s
 => [internal] load .dockerignore                                          0.1s
[2022-08-05T18:57:41.388Z]  => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/node:16.13.0            0.8s
 => [internal] load build context                                          0.0s
 => => transferring context: 1.57kB                                        0.0s
 => [ 1/10] FROM docker.io/library/node:16.13.0@sha256:580a0850049c59a48f  0.0s
 => CACHED [ 2/10] RUN userdel -r node                                     0.0s
 => CACHED [ 3/10] RUN groupadd --gid 1000 lullo-user     && useradd --ui  0.0s
 => CACHED [ 4/10] RUN mkdir -p /home/lullo-user/.vscode-server/extension  0.0s
 => CACHED [ 5/10] RUN chsh -s /bin/bash lullo-user                        0.0s
 => CACHED [ 6/10] WORKDIR /home/lullo-user                                0.0s
 => CACHED [ 7/10] COPY docker/scripts/* ./.lullo/                         0.0s
 => CACHED [ 8/10] COPY .devcontainer/env.container.lullo ./.lullo/env.lu  0.0s
[2022-08-05T18:57:41.388Z]  => CACHED [ 9/10] COPY docker/icons/* ./.lullo/icons/                     0.0s
 => CACHED [10/10] RUN mkdir app                                           0.0s
[2022-08-05T18:57:41.388Z]  => exporting to image                                                     0.1s
[2022-08-05T18:57:41.388Z]  => => exporting layers                                                    0.0s
[2022-08-05T18:57:41.414Z] [+] Building 1.0s (15/15) FINISHED                                              
[2022-08-05T18:57:41.415Z]  => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 32B                                        0.0s
 => [internal] load .dockerignore                                          0.1s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/node:16.13.0            0.8s
 => [internal] load build context                                          0.0s
 => => transferring context: 1.57kB                                        0.0s
 => [ 1/10] FROM docker.io/library/node:16.13.0@sha256:580a0850049c59a48f  0.0s
 => CACHED [ 2/10] RUN userdel -r node                                     0.0s
 => CACHED [ 3/10] RUN groupadd --gid 1000 lullo-user     && useradd --ui  0.0s
 => CACHED [ 4/10] RUN mkdir -p /home/lullo-user/.vscode-server/extension  0.0s
 => CACHED [ 5/10] RUN chsh -s /bin/bash lullo-user                        0.0s
 => CACHED [ 6/10] WORKDIR /home/lullo-user                                0.0s
 => CACHED [ 7/10] COPY docker/scripts/* ./.lullo/                         0.0s
 => CACHED [ 8/10] COPY .devcontainer/env.container.lullo ./.lullo/env.lu  0.0s
 => CACHED [ 9/10] COPY docker/icons/* ./.lullo/icons/                     0.0s
 => CACHED [10/10] RUN mkdir app                                           0.0s
 => exporting to image                                                     0.1s
 => => exporting layers                                                    0.0s
 => => writing image sha256:690d647e79620eead0fdcc1361dcf61df6438fc07623e  0.0s
[2022-08-05T18:57:41.415Z]  => => naming to docker.io/library/lullo_devcontainer-workspace            0.0s
[2022-08-05T18:57:41.560Z] 
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
[2022-08-05T18:57:41.562Z] Stop (1344 ms): Run: docker-compose --project-name lullo_devcontainer -f /home/omar/Lullo/.devcontainer/docker-compose.yml build
[2022-08-05T18:57:41.562Z] Start: Run: docker inspect --type image lullo_devcontainer_workspace
[2022-08-05T18:57:41.642Z] Stop (80 ms): Run: docker inspect --type image lullo_devcontainer_workspace
[2022-08-05T18:57:41.642Z] Start: Run: docker pull lullo_devcontainer_workspace
[2022-08-05T18:57:41.715Z] Using default tag: latest
[2022-08-05T18:57:44.431Z] Error response from daemon: pull access denied for lullo_devcontainer_workspace, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
[2022-08-05T18:57:44.432Z] Stop (2790 ms): Run: docker pull lullo_devcontainer_workspace
[2022-08-05T18:57:44.433Z] []
[2022-08-05T18:57:44.433Z] Error: No such image: lullo_devcontainer_workspace

[2022-08-05T18:57:44.432Z] Error: Command failed: docker inspect --type image lullo_devcontainer_workspace
[2022-08-05T18:57:44.432Z]     at eS (/home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js:203:2698)
[2022-08-05T18:57:44.432Z]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-08-05T18:57:44.433Z]     at async ES (/home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js:260:2177)
[2022-08-05T18:57:44.433Z]     at async no (/home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js:260:3110)
[2022-08-05T18:57:44.433Z]     at async rP (/home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js:353:8748)
[2022-08-05T18:57:44.433Z]     at async nP (/home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js:353:8504)
[2022-08-05T18:57:44.435Z] Stop (4709 ms): Run in Host: /home/omar/.vscode-server-insiders/bin/73fd3f11032e7b83c2ae011b5516e6ddd19e3db2/node /home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/omar/Lullo --workspace-mount-consistency cached --id-label devcontainer.local_folder=\\wsl.localhost\Ubuntu-20.04\home\omar\Lullo --log-level debug --log-format json --config /home/omar/Lullo/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-08-05T18:57:44.435Z] Exit code 1
[2022-08-05T18:57:44.438Z] Command failed: /home/omar/.vscode-server-insiders/bin/73fd3f11032e7b83c2ae011b5516e6ddd19e3db2/node /home/omar/.vscode-remote-containers/dist/dev-containers-cli-0.243.0/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/omar/Lullo --workspace-mount-consistency cached --id-label devcontainer.local_folder=\\wsl.localhost\Ubuntu-20.04\home\omar\Lullo --log-level debug --log-format json --config /home/omar/Lullo/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-08-05T18:57:44.438Z] Exit code 1
[2022-08-05T18:57:47.559Z] Start: Run: wsl -d Ubuntu-20.04 -e wslpath -u \\wsl.localhost\Ubuntu-20.04\home\omar\Lullo
[2022-08-05T18:57:47.716Z] Stop (157 ms): Run: wsl -d Ubuntu-20.04 -e wslpath -u \\wsl.localhost\Ubuntu-20.04\home\omar\Lullo

UPDATE I've made it work by explicitly setting the image name in the docker-compose.yml, like:

version: '3'
services:
  # Update this to the name of the service you want to work with in your docker-compose.yml file
  workspace:
    image: 'lullo-devcontainer'  # HERE
    user: lullo-user
    build: ../
    volumes:
      - ..:/home/lullo-user/Lullo:cached
      - vscode-volume:/home/lullo-user/.vscode-server/extensions:cached
      - vscode-insiders-volume:/home/lullo-user/.vscode-server-insiders/extensions:cached
    environment:
      - USER=lullo-user
    command: tail -f /dev/null   # stopping container takes about 10 sec.
    tty: true 
    extra_hosts:
      - "host.docker.internal:host-gateway"
volumes:
  vscode-volume:
  vscode-insiders-volume:

It is working, but sure looks like a bug to me.

jkeech commented 2 years ago

@OmarOmeiri can you please share which version of Docker Compose you have installed by running docker-compose version? It looks like Compose is generating images names with a hyphen when the devcontainer CLI is expecting Compose to generate the names with an underscore.

jkeech commented 2 years ago

It looks like Docker Compose made a breaking change in 2.8.0, which was subsequently reverted in 2.9.0. This sounds related.

https://github.com/docker/compose/releases/tag/v2.8.0

⚠️ Warning notice ⚠️

This release introduced a breaking change via compose-go v1.3.0 and this https://github.com/compose-spec/compose-go/pull/294. Docker Compose will recreate new resources (networks, volumes, secrets, configs...) with new names, using a - instead a _ and try to connect/use to this new created resources instead of your existing ones! Please use Compose v2.9.0 instead

If you are on Compose 2.8.0, can you try updating to 2.9.0 and see if the issue is fixed?

JensVanhooydonck commented 2 years ago

For me this issue still exist with docker-compose 2.9.0. The trick with adding the image name solved this for now.

OmarOmeiri commented 2 years ago

It looks like Docker Compose made a breaking change in 2.8.0, which was subsequently reverted in 2.9.0. This sounds related.

https://github.com/docker/compose/releases/tag/v2.8.0

⚠️ Warning notice ⚠️ This release introduced a breaking change via compose-go v1.3.0 and this compose-spec/compose-go#294. Docker Compose will recreate new resources (networks, volumes, secrets, configs...) with new names, using a - instead a _ and try to connect/use to this new created resources instead of your existing ones! Please use Compose v2.9.0 instead

If you are on Compose 2.8.0, can you try updating to 2.9.0 and see if the issue is fixed?

I'm actually using v2.9.0

jowax commented 2 years ago

@jkeech Seems like the revert was only for resources. - will still be used as the default separator for container names from v2.8.0 and forwards according to https://github.com/docker/compose/pull/9700#issuecomment-1206395531 .

chrmarti commented 2 years ago

Continuing in https://github.com/microsoft/vscode-remote-release/issues/7047.