It's taken me nearly a month to find bits and snatches of time to process this. I should have responded sooner.
It's almost as lightweight as the ideal I had in mind, and it's worth the few extra bytes. Thanks for setting this up, writing the docs, and letting us know about it, M0E-lnx!
Only remaining objection I had was the typing involved each time a container was (re)started. But that's not hard to handle, right? With the clone of my vl71 fork residing at ~/gits/vl71-roarde and a directory of disposable items kept at ~/scratch, I tag this function to the end of ~/.bashrc:
s71(){ # List, create, re-enter, or remove vl71 docker containers
case $# in
0) # With no parameters, list containers
docker ps -af 'image=vector:7.1-bb'| (
while read; do
set -- ${REPLY}
[ "x$1" = "xCONTAINER" ] || { shift $(( $# -1 )); echo $1; }
done
)
;;
1) # Start existing container $1, or create new
docker start -ai $1 || {
echo Creating new container \""$1"\"
docker run -ti -v ~/gits/vl71-roarde/var/vabs:/vabs \
-v ~/scratch:/scratch --name "$1" vector:7.1-bb /bin/bash
}
;;
2) # Remove container or list its details
case "$1" in
"ls") docker ps -af 'image=vector:7.1-bb' -f "name=$2" ;;
"rm") docker rm "$2" ;;
*) echo \""$1 $2"\"'. Really?'; return 1 ;;
esac
;;
# This disallows multiple params for ls, rm; maybe for the better
*) echo 'oops!'; return 1 ;;
esac
}
Rather than import tools (like my text editor) into the container, I choose to do the work other than the build from a terminal running directly on my host. As mounted, the changes are accessible from inside, as you said.
Adding 64-bit containers would be trivial should I find myself on such a machine. Just rename "s71" to "s7132" and modify that to get an additional "s7164". Grab and process
http://vlcore.vectorlinux.com/pkg/vlbuildslave/docker-images/VL64-7.1-BB-FINAL_vlbb-docker.tar.xzjust as above. Probably would want to add arch tagging of container name to my functions, but I'll worry about that should I get there.
What I like most is that separate containers can be used for each potential package, and the overhead is just the
difference between the new container and the original image -- rather than a whole new, duplicated filesystem for each project like would be needed to do that with chroot alone or such.