Search code examples
dockerboot2docker

my own customizations of boot2docker are not reflected into the iso image


Following the section at Making your own customised boot2docker ISO, i wrote the Dockerfile below to install the vim package:

FROM boot2docker/boot2docker

RUN apt-get update && apt-get install -y vim

RUN /make_iso.sh

CMD ["cat", "boot2docker.iso"]

Then executed these commands successfully:

docker build -t my-boot2docker-img . && docker run --rm my-boot2docker-img > boot2docker.iso

I created a virtual machine using this iso image and logged into it. I've expected the vim is now available on my shell but it was not. From the build process console logs, i saw the vim installed successfully. However it is apparently not included in the iso.

Can someone please tell me, what i've missed here?


Solution

  • You only installed vim in the build container that produces the final boot2docker iso. To get the desired result you need to install any packages/data at $ROOTFS in the build container. For some hints on how to accomplish this with apt-get see this answer.

    But first you should ask yourself why you need vim in a VM that is only meant as a transparent proxy for mac/windows users.

    Edit:

    As you got valid reasons to build your own boot2docker iso, have a look at the boot2docker repo.

    The dockerfile broken down:

    1. install build dependencies in the build container
    2. download and compile a linux kernel with aufs support, copy to $ROOTFS
    3. download and extract TinyCore distribution at $ROOTFS
    4. download and extract TinyCore packages defined in $TCZ_DEPS to $ROOTFS
    5. build and install VMware tools and other helpers at $ROOTFS
    6. export $ROOTFS as new iso

    I'd probably look into extending on step 4 first, i.e. simply download packages from the TinyCore repo.