Reduce Docker installation size in the disk #meta-virtualization #yocto
I use yocto build for creating Kernel and Rootfs images to be used in CM4 module. I use core-image-minimal which produces a nice 30M (Kernel + RFS) image. But when is include docker with:
IMAGE_INSTALL:append = " python3-docker-compose"
IMAGE_INSTALL:append = " docker-ce"
The image size increases by 320M(Kernel + RFS). Is there a way to remove some unnecessary components from docker? I am quite new to docker and its internal components. I have fixed offsets in by boot loader, so, I am finding it hard to boot the board with the new Kernel and RFS.
Any help will be greatly appreciated. Thanks.
Quoted 4 lines · On Mon, Feb 26, 2024 at 1:09 AM <[email protected]> wrote:
I use yocto build for creating Kernel and Rootfs images to be used in CM4 module. I use core-image-minimal which produces a nice 30M (Kernel + RFS) image. But when is include docker with:
IMAGE_INSTALL:append = " python3-docker-compose"
Unless you are actively building docker deployments on the target, you shouldn't need anything related to docker-compose.
Quoted 4 lines
IMAGE_INSTALL:append = " docker-ce"
The image size increases by 320M(Kernel + RFS). Is there a way to remove some unnecessary components from docker? I am quite new to docker and its internal components. I have fixed offsets in by boot loader, so, I am finding it hard to boot the board with the new Kernel and RFS.
Docker is not a small / light stack (when considered in embedded terms). Most of the backends and broad support are not from external libraries, etc, and as such are not easy to configure out of the build. I've never spent much time looking to see if we could make any of them optional. I set the default build options (DOCKER_BUILDTAGS) to already be fairly light in the recipe, but you could always look to see if more could be removed. I don't think you'll find significant things to remove and not much size removed. golang itself is going to take up quite a bit of space, as will the other package dependencies of docker.
If you are size constrained on your target, my suggestion is to just use the container runtimes directly. Just putting runc or crun on the target to execute OCI containers is much lighter than any of the container frameworks.
Bruce
Quoted 15 lines
Any help will be greatly appreciated. Thanks.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8582): https://lists.yoctoproject.org/g/meta-virtualization/message/8582
Mute This Topic: https://lists.yoctoproject.org/mt/104577876/1050810
Mute #meta-virtualization:https://lists.yoctoproject.org/g/meta-virtualization/mutehashtag/meta-virtualization Mute #yocto:https://lists.yoctoproject.org/g/meta-virtualization/mutehashtag/yocto
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II