Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu based docker-machine image

Is there a possibility to simply create a docker-machine that is non-boot2docker based (i.e., Ubuntu based) (which uses virtualbox driver)?

I would like to have full-featured Linux distro running the docker daemon on my mac instead of Tiny Core Linux distro which is fast and lightweight but doesn't offer me all the debugging facilities I need.

I know I can create it manually. I'm just wondering if there is a simple way such as docker-machine create is.

like image 530
Stepan Vavra Avatar asked Nov 18 '15 21:11

Stepan Vavra


People also ask

Is Ubuntu a Docker image?

The official Ubuntu Docker image is the most downloaded image from Docker Hub.

Can I run a Ubuntu VM on Docker?

This template allows you to deploy an Ubuntu VM with Docker (using the Docker Extension). You can later SSH into the VM and run Docker containers.

Does Ubuntu need Docker machine?

Docker-machine is a tool that simplifies running docker on VMs, but it's not required in any environment if you want to manage the VM yourself. Since docker runs natively on Linux, there's no need to docker-machine to perform that install, you just install docker directly. This is what most people do with a Linux host.


1 Answers

You could take advantage of the --virtualbox-boot2docker-url option.
This issue illustrates its usage (with an iso which is not a TinyCore one, but a RancherOS one)

docker-machine create -d virtualbox --virtualbox-boot2docker-url https://releases.rancher.com/os/latest/machine-rancheros.iso rancher

If RancherOS is a bit too bare, you can take some clues from how boot2docker is currently built, and build your own distro.

The key is to remove the parts not needed in order to be able to launch headless VM without using too much memory.

# Remove useless kernel modules, based on unclejack/debian2docker 
RUN cd $ROOTFS/lib/modules && \
rm -rf ./*/kernel/sound/* && \
rm -rf ./*/kernel/drivers/gpu/* && \
...
like image 73
VonC Avatar answered Nov 04 '22 03:11

VonC