Running Alpine in a Docker Container: Difference between revisions

From Alpine Linux
(Update method for adding linux kernel.)
 
Line 5: Line 5:
By default mkinitfs will use the running kernel to build the initfs. Since your Docker container is under some other kernel you need to specify this manually.
By default mkinitfs will use the running kernel to build the initfs. Since your Docker container is under some other kernel you need to specify this manually.


Alpine 3.11 and later:<sup>1</sup>
<code>apk add linux-lts</code>
Alpine 3.10 and earlier:
<code>apk add linux-vanilla</code>
<code>apk add linux-vanilla</code>


Line 17: Line 21:


[[Category:Virtualization]]
[[Category:Virtualization]]
== References ==
# [https://git.alpinelinux.org/aports/commit/?h=3.11-stable&id=eba4f554cc53325bb37f0cca97a5dfd024582271 Natanael Copa, "vanilla: remove linux-vanilla. replaced by linux-lts," Alpine Linux aports repository, commit eba4f554, 12 Dec 2019, (https://git.alpinelinux.org/aports/commit/?h=3.11-stable&id=eba4f554cc53325bb37f0cca97a5dfd024582271 accessed 19 May 2022).]

Latest revision as of 02:23, 20 May 2022

Some things you might want to know if you're running Alpine in a Docker container.

using mkinitfs

By default mkinitfs will use the running kernel to build the initfs. Since your Docker container is under some other kernel you need to specify this manually.

Alpine 3.11 and later:1 apk add linux-lts

Alpine 3.10 and earlier: apk add linux-vanilla

cat /usr/share/kernel/vanilla/kernel.release

mkinitfs 4.19.41-0-vanilla

mkinitfs `cat /usr/share/kernel/vanilla/kernel.release`

See also

References

  1. Natanael Copa, "vanilla: remove linux-vanilla. replaced by linux-lts," Alpine Linux aports repository, commit eba4f554, 12 Dec 2019, (https://git.alpinelinux.org/aports/commit/?h=3.11-stable&id=eba4f554cc53325bb37f0cca97a5dfd024582271 accessed 19 May 2022).