This tools is designed to produce minimal busybox-based Docker container images using a cleanroom-style build environment.
First up, clone yourself a copy of the repository
git clone https://github.com/GreyDev/docker-cleanroom.git
cd docker-cleanroom
Next up we need to create our base build environment. This image contains a full image of Ubuntu, and building this will take care of the heavy lifting in installing build-essentials and other tools. This will speed up our builds considerably.
./contrib/build-ubuntu-dev/build.sh
Once we have our base build container, we can start being productive. Let's build our first container.
./build.sh <build scripts> <output container>
./build.sh busybox mybusybox
./build.sh httpd myhttpd
Hopefully, if all goes well we should see Building Docker image busybox complete..
We can test our image using standard Docker commands:
docker images
docker run -t -i mybusybox /bin/ash
docker run -t -i -p 80:80 myhttpd /bin/thttpd -D
And we're done!
Custom containers can be created very simply. An example build-httpd has been supplied.
The process is as follows:
- A clean build environment is created using our custom ubuntu-dev as a base
- A working directory for our Busybox root filesystem is created in
/rootfs - We add
install/install.shinto our build evironment - We create a container from the image, and run the install scrips.
/rootfs.taris created from/rootfs/rootfs.taris extracted from the build environment- A final image is produced using the
rootfs.tar