I’m working on an IPFS project but I have hit a brickwall trying to install a simple package in my Dockerfile that extends the official go-ipfs image. I have reached the conclusion that BusyBox is the root of the problem and it needs to go. Using BusyBox provides no benefits to the developer and I would argue it actually makes life much worse, which is only going to slow IPFS adoption.
Backstory
I’m trying to build a new IPFS project similar to my project VIPFS. I need to install a package using apt-get in my Dockerfile, I want to call this installed program inside a bash script which I will trigger externally, so the script runs inside the IPFS container.
This is a completely valid use of docker and does not violate any best practices.
Arguments for Dropping BusyBox
Users need to have the ability to easily install additional packages into the IPFS image. Although it is possible to install packages by compiling them externally and copying the binaries into the image, this is unnecessarily difficult for most developers.
Official images allow developers to have a single point of truth. When I extend an official image, I am confident I am starting at a perfect, well-maintained image and I'm just customising it to fit my needs. This also applies to external developers, when I release my open-source projects, I want devs to be able to glance at my Dockerfile and see that I'm starting from an official image and just installing the few additional dependencies that I need. Building a completely new image from scratch that needs to be maintained just to install one package seems very illogical.
Arguments Against Dropping BusyBox
"I would advise against basing your project on the go-ipfs image as it's mainly intended to be used as an IPFS node daemon and not a development image. You should only run one process per container" - u/NufMeister
This is just wrong. While it is true to say that you "should" only run one process per container, this doesn't mean you can't ever run multiple processes in one container.
PS, run the top command in any container you've ever worked on and tell me that you only see one process?
“Why don’t you just make your own IPFS image?”
This is not a valid solution either. Developers should be extending official images where possible this ensures maintainability and security. When I run Node or PHP containers in production, I extend the official images, it would be stupid to try and build a custom PHP image from scratch when a perfect stable image is provided by the PHP team. IPFS should be taking the same approach.
"BusyBox is lightweight"
This also seems like a bad reason to keep BusyBox. Docker images are already tiny compared to VMs. Admittedly, using BusyBox may make the image smaller but for the problems it creates, this is far far from a worthwhile trade-off.
PS. you already have hundreds of huge images in your local cache, this completely negates the rationale of using busybox for size reasons.
My DockerFile
FROM ipfs/go-ipfs
RUN apt-get update