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

Outdated docker image versions used for building stages with DevContainer #9899

Open
petgan opened this issue May 18, 2024 · 0 comments
Open
Assignees
Labels
containers Issue in vscode-remote containers debt

Comments

@petgan
Copy link

petgan commented May 18, 2024

When building a DevContainer it do so in multi-stages depending on functionality. In various steps it uses some base docker image in order to finally produce the final image.

It would be nice for peoples like me that need some up today functionality if you update the image versions used for those intemidiate stages to some more recent ones. Doing so will allow the use of recent version of docker-cli, docker-cli-buildx, docker-cli-compose to be used in the process and eliminate some confusions why my docker-cli do not understand new features!
As in fact locally installed docker version does not participate in all build stages.

As of now I found that one of those image is : mcr.microsoft.com/devcontainers/base:0-alpine-3.16 , alpine 3.16 was release : 2022-05-23
Manual build of the stage shows ( vsch\bootstrap-image\0.354.0\bootstrap.Dockerfile ) :

docker run -ti --rm mcr.microsoft.com/devcontainers/base:0-alpine-3.16 bash
root ➜ / $ apk add --no-cache \
        git-lfs \
        nodejs \
        python3 \
        npm \
        make \
        g++ \
        docker-cli \
        docker-cli-buildx \
        docker-cli-compose
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
(1/14) Installing docker-cli (20.10.20-r0)
(2/14) Installing docker-cli-buildx (0.8.2-r6)
(3/14) Installing docker-cli-compose (2.12.2-r0)

The last alpine vertion is 3.19.0 released : 2023-12-07. The bootstrap.Dockerfile with mcr.microsoft.com/devcontainers/base:0-alpine-3.19 shows

docker run -ti --rm mcr.microsoft.com/devcontainers/base:0-alpine-3.19 bash
root ➜ / $ apk add --no-cache \
        git-lfs \
        nodejs \
        python3 \
        npm \
        make \
        g++ \
        docker-cli \
        docker-cli-buildx \
        docker-cli-compose
fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
(1/19) Installing docker-cli (25.0.5-r1)
(2/19) Installing docker-cli-buildx (0.12.0-r3)
(3/19) Installing docker-cli-compose (2.23.3-r3)

My work around is to juste do this:

# Delete the 0-alpine-3.16 version locally
docker image rm mcr.microsoft.com/devcontainers/base:0-alpine-3.16

# Pull 0-alpine-3.19 version locally
docker pull mcr.microsoft.com/devcontainers/base:0-alpine-3.19
# Cheat :-)
docker image tag mcr.microsoft.com/devcontainers/base:0-alpine-3.19 mcr.microsoft.com/devcontainers/base:0-alpine-3.16

And then rebuild the DevContainer

Steps to Reproduce:

As my essue was with docker compose include fonctionnality which was added in docker compose 2.20.3 (2023-08-11)
Not sure if it matters but I'm building DevContainer from a remote cloned repository to a docker volume.

( Ctrl+Shift+P ) / Dev Containers: Clone Repository in Container Volume

  1. DevContainer setup
    devcontainer.json
{
  // ...
  "dockerComposeFile": "docker-compose.yml",
  "service": "my-project-devcontainer",
  // ...
}
  1. docker-compose.yml
version: '3'

include:
  - docker-compose-base.yml

  • VSCode Version: 1.89.1

  • Local OS Version: Windows 10

  • Remote OS Version: N/A

  • Remote Extension/Connection Type: DevContainer

  • Logs:

[2024-05-17T21:49:15.561Z] Dev Containers 0.354.0 in VS Code 1.89.1 (dc96b837cf6bb4af9cd736aa3af08cf8279f7685).
[2024-05-17T21:49:15.561Z] Start: Resolving Remote
[2024-05-17T21:49:15.577Z] Start: Check Docker is running
[2024-05-17T21:49:15.577Z] Start: Run: docker version
[2024-05-17T21:49:15.699Z] Initializing configuration support...
[2024-05-17T21:49:15.700Z] Internal initialization of dev container support package...
[2024-05-17T21:49:15.709Z] Client:
 Version:           25.0.4-rd
 API version:       1.44
 Go version:        go1.21.8
 Git commit:        c4cd0a9
 Built:             Fri Mar  8 09:11:41 2024
 OS/Arch:           windows/amd64
 Context:           default

Server:
 Engine:
[2024-05-17T21:49:15.710Z]   Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.8
  Git commit:       f417435e5f6216828dec57958c490c4f8bae4f98
  Built:            Wed Mar  6 12:07:44 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.7.10
  GitCommit:        4e1fe7492b9df85914c389d1f15a3ceedbb280ac
 runc:
  Version:          1.1.12
  GitCommit:        51d5e94601ceffbbd85688df1c928ecccbfa4685
 docker-init:
  Version:          0.19.0
  GitCommit:        

....

[2024-05-17T21:49:15.850Z] Start: Run: docker build -f C:\Users\user1\AppData\Local\Temp\vsch\bootstrap-image\0.354.0\bootstrap.Dockerfile -t vsc-volume-bootstrap C:\Users\user1\AppData\Local\Temp\vsch\bootstrap-image\0.354.0
[2024-05-17T21:49:16.033Z] 
[2024-05-17T21:49:16.368Z] 
[+] Building 0.0s (0/1)                                          docker:default
[2024-05-17T21:49:16.492Z] 
[+] Building 0.1s (13/13) FINISHED                               docker:default
 => [internal] load build definition from bootstrap.Dockerfile             0.0s
 => => transferring dockerfile: 982B                                       0.0s
 => [internal] load metadata for mcr.microsoft.com/devcontainers/base:0-a  0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [1/8] FROM mcr.microsoft.com/devcontainers/base:0-alpine-3.16          0.0s
 => [internal] load build context                                          0.0s
 => => transferring context: 86.21kB                                       0.0s
 => CACHED [2/8] COPY host-ca-certificates.crt /tmp/host-ca-certificates.  0.0s
 => CACHED [3/8] RUN cat /tmp/host-ca-certificates.crt >> /etc/ssl/certs/  0.0s
 => CACHED [4/8] RUN csplit -f /usr/local/share/ca-certificates/host-ca-c  0.0s
 => CACHED [5/8] RUN echo "@old https://dl-cdn.alpinelinux.org/alpine/v3.  0.0s
 => CACHED [6/8] RUN apk add --no-cache  git-lfs  nodejs  python3  npm  m  0.0s
 => CACHED [7/8] RUN npm config set cafile /etc/ssl/certs/ca-certificates  0.0s
 => CACHED [8/8] COPY .vscode-remote-containers /root/.vscode-remote-cont  0.0s
 => exporting to image                                                     0.0s
 => => exporting layers                                                    0.0s
 => => writing image sha256:fac86aed685a7c24f42c23feb1e89861e6a328ca7e17c  0.0s
 => => naming to docker.io/library/vsc-volume-bootstrap                    0.0s
[2024-05-17T21:49:16.585Z] Stop (735 ms): Run: docker build -f C:\Users\user1\AppData\Local\Temp\vsch\bootstrap-image\0.354.0\bootstrap.Dockerfile -t vsc-volume-bootstrap C:\Users\user1\AppData\Local\Temp\vsch\bootstrap-image\0.354.0
[2024-05-17T21:49:16.586Z] Cloning Github repository: my--projects/my-dev-container-project into /workspaces/my-dev-container-project

....

[2024-05-17T21:49:20.926Z] Start: Run: docker compose -f /workspaces/my-dev-container-project/.devcontainer/docker-compose-opentelemetry.yml --profile * config
[2024-05-17T21:49:21.000Z] Stop (74 ms): Run: docker compose -f /workspaces/my-dev-container-project/.devcontainer/docker-compose-opentelemetry.yml --profile * config
[2024-05-17T21:49:21.000Z] 
[2024-05-17T21:49:21.000Z] (root) Additional property include is not allowed

[2024-05-17T21:49:21.001Z] Exit code 15
[2024-05-17T21:49:21.001Z] Error: Command failed: docker compose -f /workspaces/my-dev-container-project/.devcontainer/docker-compose-opentelemetry.yml --profile * config

@VSCodeTriageBot VSCodeTriageBot added the containers Issue in vscode-remote containers label May 18, 2024
@chrmarti chrmarti added the debt label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers debt
Projects
None yet
Development

No branches or pull requests

3 participants