Custom disk images
How to create custom ext2 images to use as a filesystem for CheerpX
This guide will show you how to configure a Docker container and build it into an ext2
image for use with CheerpX.
1. Create a Dockerfile
First, create your Dockerfile
to define the environment. Here’s an example of how to build a Docker image that installs the curl
command:
NoteThe base image’s architecture must be 32-bit x86 (for example, i386 or i686).
2. Create a container out of your Dockerfile
Once the Dockerfile
is ready, build the image. Use buildah
to create a container image for your filesystem.
3. Create a container from the Docker Image
Now, create a container from the image using podman
. Ensure the image name matches the on you built in the previous step.
4. Copy the Filesystem from the Container into a local directory
Create a directory for the filesystem:
Use the podman cp command to copy the container’s filesystem into the local directory:
NoteThe podman unshare command helps avoid permission problems by running the operation in a special mode where you act like the container’s “root user.”
5. Create an ext2 Image from the local directory
Now that you have the local directory, you can create an ext2
image from it:
6. Clean up unused resources
After creating your ext2
image, it’s a good practice to clean up unused resources to free up space:
Remove the container:
Remove the image:
Remove temporary directories: