docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.44k stars 119 forks source link

Unable to locate package linux-tools-5.15.49-linuxkit #6656

Open 631068264 opened 1 year ago

631068264 commented 1 year ago

Expected behavior

FROM docker/for-desktop-kernel:5.15.49-13422a825f833d125942948cf8a8688cef721ead AS ksrc

FROM ubuntu:20.04 AS bpftrace
COPY --from=ksrc /kernel-dev.tar /
RUN tar xf kernel-dev.tar && rm kernel-dev.tar
# Use Alibaba Cloud mirror for ubuntu

#RUN apt-get update && apt install -y --no-install-recommends apt-transport-https ca-certificates
COPY source.list /etc/apt/sources.list
#RUN sed -i "s@http://.*archive.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list && sed -i "s@http://.*security.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list

# Install LLVM 10.0.1
RUN  apt-get update && apt-get upgrade && apt-get dist-upgrade && apt install -y --no-install-recommends wget lsb-release software-properties-common \
    kmod vim bison build-essential cmake flex git libedit-dev \
    libcap-dev zlib1g-dev libelf-dev libfl-dev python3.8 python3-pip python3.8-dev clang libclang-dev \
    llvm libpcap-dev gcc-multilib linux-tools-$(uname -r) linux-headers-$(uname -r) linux-tools-common linux-tools-generic tcpdump bpftrace && \
    ln -s $(which python3) /usr/bin/python

.....

get error

#9 21.97 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#9 21.97 
#9 22.01 Reading package lists...
#9 23.01 Building dependency tree...
#9 23.20 Reading state information...
#9 23.27 E: Unable to locate package linux-tools-5.15.49-linuxkit
#9 23.27 E: Couldn't find any package by glob 'linux-tools-5.15.49-linuxkit'
#9 23.27 E: Unable to locate package linux-headers-5.15.49-linuxkit
#9 23.27 E: Couldn't find any package by glob 'linux-headers-5.15.49-linuxkit'
------

Actual behavior

Information

Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

Steps to reproduce the behavior

  1. ...
  2. ...
debugger24 commented 1 year ago

Having the same issue, need linux-headers-5.15.49-linuxkit package.

thaJeztah commented 1 year ago

This feels somewhat expected; you're extracting information from the linuxkit kernel image (which uses 5.15.49-linuxkit as version), but some of the packages you're installing try to deduct the kernel version to use from that information, and try to use ubuntu 20.04's package repositories to find those. Ubuntu's package repository will only have headers for the Ubuntu kernel, so those packages won't be able to find headers / kernel packages for the linuxkit kernel.

This would be somewhat similar to installing information from (say) the Fedora kernel, and trying to get headers from the Ubuntu repository.

Lan-ce-lot commented 1 year ago

Having the same issue, need linux-headers-5.15.49-linuxkit package.

Dentrax commented 1 year ago

I also having same issue with kind cluster that I created with: kind create cluster --name test

Exec into node's container and see the same error.

girish97115 commented 10 months ago

linux-headers-5.15.49-linuxkit is not available.

when I try to install generic package and run it downloads 5.15.0-91-generic But when I run add something to kernel it gives modprobe: ERROR: could not insert 'overlay': Exec format error.

Is it not possible to manage at kernel level when using a hypervisor ?