Score:0

How to create a docker image in WSL2 that requires installing linux-image and linux-headers

us flag

I'm using docker inside WSL2 (Ubuntu), and trying to create a docker image. The image requires to install: apt install -y linux-image-$(uname -r) linux-headers-$(uname -r).

I'm getting the following errors:

E: Unable to locate package linux-image-5.10.102.1-microsoft-standard-WSL2 
E: Unable to locate package linux-headers-5.10.102.1-microsoft-standard-WSL2
Bodo avatar
pt flag
What happens when you try your command?
user535733 avatar
cn flag
Why would you need to install a pre-compiled Linux kernel (`linux-image-$(uname -r)`) into the *virtual* environment of WSL2? The Windows kernel (not Linux kernel) controls all real hardware. Could this be an [XY Problem](https://en.wikipedia.org/wiki/XY_problem)?
Dr.PB avatar
us flag
`E: Unable to locate package linux-image-5.10.102.1-microsoft-standard-WSL2` `E: Unable to locate package linux-headers-5.10.102.1-microsoft-standard-WSL2` What I'm trying to do is create a docker image inside WSL2 which requires those.
Bodo avatar
pt flag
Please [edit] your question to add requested information or clarification. I suggest to write your basic question, e.g. "How to create a docker image in WSL2 (Ubuntu)?" and show what steps you are doing and where you are having problems.
Artur Meinild avatar
vn flag
You don't install a kernel on Docker containers.
NotTheDr01ds avatar
vn flag
Did you figure this out? I just noticed I still had this open in a tab I'd forgotten about. There's probably a solution, but it may be necessary to know why you believe your image needs the headers in the first place. What type of image are/were you trying to create?
Dr.PB avatar
us flag
Nope, moved on. I was checking steps for host os, and trying to replicate it on docker.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.