devcontainers / features

A collection of Dev Container Features managed by Dev Container spec maintainers. See https://github.com/devcontainers/feature-starter to publish your own
https://containers.dev/features
MIT License
934 stars 380 forks source link

Resurfaced issue: Ubuntu:focal + latest docker-in-docker feature fails to prebuild due to Moby package validation issue #1167

Closed sayhiben closed 2 weeks ago

sayhiben commented 2 weeks ago

Our Codespaces prebuilds are suddenly failing today due to a package registry mismatch with a very similar issue to #837

devcontainer.json entry:

    "ghcr.io/devcontainers/features/docker-in-docker:2": {
      "version": "latest"
    }

Build log:

#28 0.687 ===========================================================================
#28 0.687 Feature       : Docker (Docker-in-Docker)
#28 0.687 Description   : Create child containers *inside* a container, independent from the host's docker instance. Installs Docker extension in the container along with needed CLIs.
#28 0.691 Id            : ghcr.io/devcontainers/features/docker-in-docker
#28 0.691 Version       : 2.12.0
#28 0.691 Documentation : ********/devcontainers/features/tree/main/src/docker-in-docker
#28 0.691 Options       :
#28 0.691     VERSION="latest"
#28 0.691     MOBY="********"#28 0.691     MOBYBUILDXVERSION="latest"
#28 0.691     DOCKERDASHCOMPOSEVERSION="latest"
#28 0.691     AZUREDNSAUTODETECTION="********"
#28 0.691     DOCKERDEFAULTADDRESSPOOL=""
#28 0.691     INSTALLDOCKERBUILDX="********"
#28 0.691     INSTALLDOCKERCOMPOSESWITCH="********"
#28 0.691     DISABLEIP6TABLES="false"
#28 0.691 ===========================================================================

[...]

#28 258.3 E: Failed to fetch https://packages.microsoft.com/repos/microsoft-ubuntu-focal-prod/pool/main/m/moby-cli/moby-cli_27.0.3-ubuntu20.04u1_amd64.deb  Hash Sum mismatch
#28 258.3    Hashes of expected file:
#28 258.3     - SHA256:31a1224489f23a686c3b1bc56caecd1b818645dd3dc377923f28f468ceadf325
#28 258.3     - Filesize:17200298 [weak]
#28 258.3    Hashes of received file:
#28 258.3     - SHA256:6595ea74048ae9add8e4b98dd2560332c05e1295a6d9e2aca44295c39b47ed1a
#28 258.3     - Filesize:17200298 [weak]

The entry in Microsoft's package registry states this, where there is a hash mismatch between what's downloaded and what the registry states

Package: moby-cli
Version: 27.0.3-ubuntu20.04u1
Architecture: amd64
Section: admin
Priority: optional
Installed-Size: 39035
Maintainer: Microsoft <support@microsoft.com>
Description: Docker container platform (client package)
 Docker is a platform for developers and sysadmins to develop, ship, and run
 applications. Docker lets you quickly assemble applications from components and
 eliminates the friction that can come when shipping code. Docker lets you get
 your code tested and deployed into production as fast as possible.
 .
 This package provides the "docker" client binary (and supporting files).
Homepage: https://github.com/docker/cli
Conflicts: docker, docker-ce, docker-ce-cli, docker-ee, docker-ee-cli, docker-engine, docker-engine-cs, docker.io, lxc-docker, lxc-docker-virtual-package
Depends: libc6 (>= 2.4)
Recommends: ca-certificates, git, moby-buildx, pigz, xz-utils
Replaces: docker, docker-ce, docker-ce-cli, docker-ee, docker-ee-cli, docker-engine, docker-engine-cs, docker.io, lxc-docker, lxc-docker-virtual-package
SHA256: 31a1224489f23a686c3b1bc56caecd1b818645dd3dc377923f28f468ceadf325
Size: 17200298
Filename: pool/main/m/moby-cli/moby-cli_27.0.3-ubuntu20.04u1_amd64.deb

It seems like when we download the file directly from the package repo, we receive the correct hash, but there is for some reason a mismatch during prebuilds, which indicates that a mirror or some other redirection may be taking place

This is blocking work for our organization. Please let me know how I can help resolve.

sayhiben commented 2 weeks ago

This appears to be resolved. If repo maintainers or someone maintainers are in contact with can express to the maintainer of that package registry how critical it is to prevent these issues, it would be appreciated. Thanks