Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local image as the base image of remote dev container Dockerfile #7425

Closed
corford opened this issue Oct 26, 2022 · 6 comments
Closed

Local image as the base image of remote dev container Dockerfile #7425

corford opened this issue Oct 26, 2022 · 6 comments
Assignees
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster

Comments

@corford
Copy link

corford commented Oct 26, 2022

Creating a dev container from a Dockerfile that references a locally built base image is not currently possible (VSCode calls docker buildx build with the --pull flag, which causes docker to ignore local images and instead try to pull them from the docker.io repository).

For example, this does not work (assuming my-app:1.0.1-test is a locally built image i.e. not yet pushed to a repository):

Dockerfile:

ARG BASE_IMAGE=my-app:1.0.0
FROM ${BASE_IMAGE}

# Install npm modules
RUN set -eux && \
    cd /opt/dcsfw && \
    npm set unsafe-perm true && npm ci --loglevel verbose

devcontainer.json

{
  "build": {
    "dockerfile": "Dockerfile",
    "args": {
      "BASE_IMAGE": "my-app:1.0.1-test"
    }
  },
  "workspaceMount": "source=${localWorkspaceFolder}/src,target=/opt/app,type=bind",
  "workspaceFolder": "/opt/app"
}

Being able to reference a local base image (as illustrated above) would be very useful when locally developing and testing a new base image for use with the project's devcontainer (since it avoids having to push it to a registry on each dev/test iteration, which is especially helpful if the base image is large... ours is ~4GB).

Since the blocker for this is the aforementioned --pull arg being passed to docker buildx build, I wonder if devcontainer.json spec could be extended with a way to signal that the --pull flag should not be passed to buildx e.g. via an extra prop in the build. options?

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Oct 26, 2022
@chrmarti
Copy link
Contributor

I see an error only when rebuilding the container with one of the "Without Cache" commands (e.g., F1 > Dev Containers: Rebuild Container Without Cache). Could you append the full log (F1 > Dev Containers: Show Container Log)?

@chrmarti chrmarti self-assigned this Oct 28, 2022
@chrmarti chrmarti added the info-needed Issue requires more information from poster label Oct 28, 2022
@cbandera
Copy link

cbandera commented Oct 28, 2022

I have the same issue and I can reproduce it with the example snippets from @corford .

The local image my-app:1.0.1-test is simply build from:

FROM alpine
CMD ["echo", "Hello!"]

and is located in my local docker cache (e.g. listed in docker images)

When I now click Rebuild and reopen in Container I get:

[2022-10-28T13:48:30.389Z] Dev Containers 0.255.4 in VS Code 1.71.2 (74b1f979648cc44d385a2286793c226e611f59e7).
[2022-10-28T13:48:30.389Z] Start: Resolving Remote
[2022-10-28T13:48:30.402Z] Setting up container for folder or workspace: /var/development/test_ws
[2022-10-28T13:48:30.406Z] Start: Check Docker is running
[2022-10-28T13:48:30.406Z] Start: Run: docker version --format {{.Server.APIVersion}}
[2022-10-28T13:48:30.446Z] Stop (40 ms): Run: docker version --format {{.Server.APIVersion}}
[2022-10-28T13:48:30.447Z] Server API version: 1.41
[2022-10-28T13:48:30.447Z] Stop (41 ms): Check Docker is running
[2022-10-28T13:48:30.448Z] Start: Run: docker volume ls -q
[2022-10-28T13:48:30.484Z] Stop (36 ms): Run: docker volume ls -q
[2022-10-28T13:48:30.490Z] Start: Run: docker ps -q -a --filter label=vsch.local.folder=/var/development/test_ws --filter label=vsch.quality=stable
[2022-10-28T13:48:30.517Z] Stop (27 ms): Run: docker ps -q -a --filter label=vsch.local.folder=/var/development/test_ws --filter label=vsch.quality=stable
[2022-10-28T13:48:30.518Z] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/var/development/test_ws
[2022-10-28T13:48:30.544Z] Stop (26 ms): Run: docker ps -q -a --filter label=devcontainer.local_folder=/var/development/test_ws
[2022-10-28T13:48:30.546Z] Start: Run: /usr/share/code/code --ms-enable-electron-run-as-node /home/username/.vscode/extensions/ms-vscode-remote.remote-containers-0.255.4/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/username/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /var/development/test_ws --workspace-mount-consistency cached --id-label devcontainer.local_folder=/var/development/test_ws --log-level debug --log-format json --config /var/development/test_ws/.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 true
[2022-10-28T13:48:30.832Z] (node:3996277) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[2022-10-28T13:48:30.832Z] (Use `code --trace-deprecation ...` to show where the warning was created)
[2022-10-28T13:48:30.834Z] @devcontainers/cli 0.20.0. Node.js v16.14.2. linux 5.4.0-126-generic x64.
[2022-10-28T13:48:30.834Z] Start: Run: docker buildx version
[2022-10-28T13:48:30.933Z] Stop (99 ms): Run: docker buildx version
[2022-10-28T13:48:30.934Z] github.com/docker/buildx v0.9.1-docker ed00243a0ce2a0aee75311b06e32d33b44729689
[2022-10-28T13:48:30.934Z] 
[2022-10-28T13:48:30.934Z] Start: Resolving Remote
[2022-10-28T13:48:30.939Z] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/var/development/test_ws
[2022-10-28T13:48:30.966Z] Stop (27 ms): Run: docker ps -q -a --filter label=devcontainer.local_folder=/var/development/test_ws
[2022-10-28T13:48:30.971Z] Start: Run: docker inspect --type image my-app:1.0.1-test
[2022-10-28T13:48:31.014Z] Stop (43 ms): Run: docker inspect --type image my-app:1.0.1-test
[2022-10-28T13:48:31.017Z] local container features stored at: /home/username/.vscode/extensions/ms-vscode-remote.remote-containers-0.255.4/dist/node_modules/vscode-dev-containers/container-features
[2022-10-28T13:48:31.019Z] Start: Run: tar --no-same-owner -x -f -
[2022-10-28T13:48:31.048Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.050Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.051Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.053Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.055Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.057Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.067Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.069Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.070Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.076Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.079Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.080Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.082Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.084Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.086Z] tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.dev“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.ino“ für erweiterten Kopfteil
tar: Ignoriere unbekanntes Schlüsselwort „SCHILY.nlink“ für erweiterten Kopfteil

[2022-10-28T13:48:31.087Z] Stop (68 ms): Run: tar --no-same-owner -x -f -
[2022-10-28T13:48:31.098Z] Start: Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-username/container-features/0.20.0-1666964911016/Dockerfile-with-features -t vsc-test_ws-8c4f325783c0140ee9ac1519a84c13b8 --target dev_containers_target_stage --build-arg BASE_IMAGE=my-app:1.0.1-test --build-context dev_containers_feature_content_source=/tmp/devcontainercli-username/container-features/0.20.0-1666964911016 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /var/development/test_ws/.devcontainer
[2022-10-28T13:48:31.390Z] [+] Building 0.0s (0/0)                                                         
[2022-10-28T13:48:31.543Z] [+] Building 0.1s (2/3)                                                         
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.1s
[2022-10-28T13:48:31.690Z] [+] Building 0.3s (2/3)                                                         
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
[2022-10-28T13:48:31.690Z]  => resolve image config for docker.io/docker/dockerfile:1.4               0.3s
[2022-10-28T13:48:31.841Z] [+] Building 0.4s (2/3)                                                         
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.4s
[2022-10-28T13:48:31.991Z] [+] Building 0.6s (2/3)                                                         
 => [internal] load build definition from Dockerfile-with-features         0.0s
[2022-10-28T13:48:31.991Z]  => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.6s
[2022-10-28T13:48:32.141Z] [+] Building 0.7s (2/3)                                                         
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
[2022-10-28T13:48:32.141Z]  => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.7s
[2022-10-28T13:48:32.292Z] 
[2022-10-28T13:48:32.292Z] [+] Building 0.9s (4/4)                                                         
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.8s
 => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531b  0.0s
 => => resolve docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a8586  0.0s
[2022-10-28T13:48:32.443Z] [+] Building 1.0s (5/6)                                                         
[2022-10-28T13:48:32.443Z]  => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.8s
 => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531b  0.0s
 => => resolve docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a8586  0.0s
[2022-10-28T13:48:32.443Z] 
 => [internal] load metadata for docker.io/library/my-app:1.0.1-test       0.1s
 => [context dev_containers_feature_content_source] load .dockerignore     0.0s
 => => transferring dev_containers_feature_content_source: 2B              0.0s
[2022-10-28T13:48:32.443Z] 
[2022-10-28T13:48:32.593Z] [+] Building 1.2s (5/6)                                                         
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
[2022-10-28T13:48:32.594Z]  => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.8s
 => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531b  0.0s
 => => resolve docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a8586  0.0s
 => [internal] load metadata for docker.io/library/my-app:1.0.1-test       0.3s
 => [context dev_containers_feature_content_source] load .dockerignore     0.0s
 => => transferring dev_containers_feature_content_source: 2B              0.0s
[2022-10-28T13:48:32.744Z] [+] Building 1.3s (5/6)                                                         
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
[2022-10-28T13:48:32.744Z]  => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.8s
 => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531b  0.0s
 => => resolve docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a8586  0.0s
 => [internal] load metadata for docker.io/library/my-app:1.0.1-test       0.4s
 => [context dev_containers_feature_content_source] load .dockerignore     0.0s
 => => transferring dev_containers_feature_content_source: 2B              0.0s
[2022-10-28T13:48:32.894Z] [+] Building 1.5s (5/6)                                                         
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.8s
[2022-10-28T13:48:32.894Z]  => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531b  0.0s
 => => resolve docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a8586  0.0s
 => [internal] load metadata for docker.io/library/my-app:1.0.1-test       0.6s
 => [context dev_containers_feature_content_source] load .dockerignore     0.0s
 => => transferring dev_containers_feature_content_source: 2B              0.0s
[2022-10-28T13:48:33.046Z] [+] Building 1.6s (5/6)                                                         
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.8s
 => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531b  0.0s
 => => resolve docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a8586  0.0s
 => [internal] load metadata for docker.io/library/my-app:1.0.1-test       0.7s
 => [context dev_containers_feature_content_source] load .dockerignore     0.0s
 => => transferring dev_containers_feature_content_source: 2B              0.0s
[2022-10-28T13:48:33.194Z] [+] Building 1.8s (5/6)                                                         
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
[2022-10-28T13:48:33.195Z]  => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.8s
 => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531b  0.0s
 => => resolve docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a8586  0.0s
 => [internal] load metadata for docker.io/library/my-app:1.0.1-test       0.9s
 => [context dev_containers_feature_content_source] load .dockerignore     0.0s
 => => transferring dev_containers_feature_content_source: 2B              0.0s
[2022-10-28T13:48:33.346Z] [+] Building 1.9s (5/6)                                                         
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.8s
 => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531b  0.0s
 => => resolve docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a8586  0.0s
 => [internal] load metadata for docker.io/library/my-app:1.0.1-test       1.0s
 => [context dev_containers_feature_content_source] load .dockerignore     0.0s
 => => transferring dev_containers_feature_content_source: 2B              0.0s
[2022-10-28T13:48:33.446Z] [+] Building 2.0s (6/6)                                                         
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.8s
 => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531b  0.0s
 => => resolve docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a8586  0.0s
 => ERROR [internal] load metadata for docker.io/library/my-app:1.0.1-tes  1.1s
 => [context dev_containers_feature_content_source] load .dockerignore     0.0s
 => => transferring dev_containers_feature_content_source: 2B              0.0s
[2022-10-28T13:48:33.484Z] [+] Building 2.1s (6/6) FINISHED                                                
 => [internal] load build definition from Dockerfile-with-features         0.0s
[2022-10-28T13:48:33.484Z]  => => transferring dockerfile: 568B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.8s
 => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531b  0.0s
 => => resolve docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a8586  0.0s
 => ERROR [internal] load metadata for docker.io/library/my-app:1.0.1-tes  1.1s
 => [context dev_containers_feature_content_source] load .dockerignore     0.0s
 => => transferring dev_containers_feature_content_source: 2B              0.0s
------
 > [internal] load metadata for docker.io/library/my-app:1.0.1-test:
------
[2022-10-28T13:48:33.487Z] Dockerfile-with-features:4
--------------------
   2 |     ARG _DEV_CONTAINERS_BASE_IMAGE=placeholder
   3 |     ARG BASE_IMAGE=my-app:1.0.0
   4 | >>> FROM ${BASE_IMAGE} AS dev_container_auto_added_stage_label
   5 |     
   6 |     # Install npm modules
--------------------
ERROR: failed to solve: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
[2022-10-28T13:48:33.499Z] Stop (2401 ms): Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-username/container-features/0.20.0-1666964911016/Dockerfile-with-features -t vsc-test_ws-8c4f325783c0140ee9ac1519a84c13b8 --target dev_containers_target_stage --build-arg BASE_IMAGE=my-app:1.0.1-test --build-context dev_containers_feature_content_source=/tmp/devcontainercli-username/container-features/0.20.0-1666964911016 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /var/development/test_ws/.devcontainer
[2022-10-28T13:48:33.502Z] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-username/container-features/0.20.0-1666964911016/Dockerfile-with-features -t vsc-test_ws-8c4f325783c0140ee9ac1519a84c13b8 --target dev_containers_target_stage --build-arg BASE_IMAGE=my-app:1.0.1-test --build-context dev_containers_feature_content_source=/tmp/devcontainercli-username/container-features/0.20.0-1666964911016 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /var/development/test_ws/.devcontainer
[2022-10-28T13:48:33.502Z]     at Vse (/home/username/.vscode/extensions/ms-vscode-remote.remote-containers-0.255.4/dist/spec-node/devContainersSpecCLI.js:1869:1635)
[2022-10-28T13:48:33.502Z]     at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-10-28T13:48:33.502Z]     at async ZA (/home/username/.vscode/extensions/ms-vscode-remote.remote-containers-0.255.4/dist/spec-node/devContainersSpecCLI.js:1868:1973)
[2022-10-28T13:48:33.502Z]     at async jO (/home/username/.vscode/extensions/ms-vscode-remote.remote-containers-0.255.4/dist/spec-node/devContainersSpecCLI.js:1868:901)
[2022-10-28T13:48:33.502Z]     at async Xse (/home/username/.vscode/extensions/ms-vscode-remote.remote-containers-0.255.4/dist/spec-node/devContainersSpecCLI.js:1874:2030)
[2022-10-28T13:48:33.503Z]     at async Uf (/home/username/.vscode/extensions/ms-vscode-remote.remote-containers-0.255.4/dist/spec-node/devContainersSpecCLI.js:1874:3193)
[2022-10-28T13:48:33.503Z]     at async Cae (/home/username/.vscode/extensions/ms-vscode-remote.remote-containers-0.255.4/dist/spec-node/devContainersSpecCLI.js:1994:10350)
[2022-10-28T13:48:33.504Z]     at async yae (/home/username/.vscode/extensions/ms-vscode-remote.remote-containers-0.255.4/dist/spec-node/devContainersSpecCLI.js:1994:10104)
[2022-10-28T13:48:33.507Z] Stop (2961 ms): Run: /usr/share/code/code --ms-enable-electron-run-as-node /home/username/.vscode/extensions/ms-vscode-remote.remote-containers-0.255.4/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/username/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /var/development/test_ws --workspace-mount-consistency cached --id-label devcontainer.local_folder=/var/development/test_ws --log-level debug --log-format json --config /var/development/test_ws/.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 true
[2022-10-28T13:48:33.508Z] Exit code 1
[2022-10-28T13:48:33.509Z] Command failed: /usr/share/code/code --ms-enable-electron-run-as-node /home/username/.vscode/extensions/ms-vscode-remote.remote-containers-0.255.4/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/username/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /var/development/test_ws --workspace-mount-consistency cached --id-label devcontainer.local_folder=/var/development/test_ws --log-level debug --log-format json --config /var/development/test_ws/.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 true
[2022-10-28T13:48:33.509Z] Exit code 1

So the main error messages in here are that VSCode is trying to pull the app from docker.io instead of checking in the local cache first:

=> ERROR [internal] load metadata for docker.io/library/my-app:1.0.1-tes  1.1s
ERROR: failed to solve: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

By the way @chrmarti do you know where all the SCHILY warnings come from?

@chrmarti
Copy link
Contributor

chrmarti commented Nov 1, 2022

Are you maybe using a different builder that has not access to docker images? What do you get for docker buildx ls and docker context ls?

Not sure where the SCHILY warnings come from. nodejs/node#22805 suggests that these are headers from BSD tar. #7190 also has a log showing these warnings. Maybe your macOS BSD tar is used when we use the tar NPM package, haven't seen these warnings myself on macOS yet though.

@corford
Copy link
Author

corford commented Nov 1, 2022

@chrmarti thanks for your earlier reply. Somehow I missed the obvious difference between F1 > Dev Containers: Rebuild Container Without Cache and F1 > Dev Containers: Rebuild Container 🤦

Happy to confirm using a local base image works fine with the latter command (as one would expect). This was with Ubuntu 18.04.6 LTS and docker 20.10.19.

@cbandera
Copy link

cbandera commented Nov 2, 2022

@chrmarti thanks for the hint with docker buildx ls. I didn't know that buildx can use different builder instances.
In my case, I had a docker-container based driver selected instead of the default. After switching back to the default instance, it worked as expected.

Since both @corford s and my issue have been resolved, I believe you can close the issue. Thanks again for the help.

@chrmarti
Copy link
Contributor

chrmarti commented Nov 4, 2022

Thanks, closing as resolved.

@chrmarti chrmarti closed this as completed Nov 4, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants