Joseph Jude

Technology, Psychology, and Story Telling

dlite makes it easy to start with docker on Mac

Posted: Tags: code,devops

Docker is great. I use it for both development and deployment. There is only one challenge: getting started with Docker on Mac is a pain.

Nathan LaFreniere of &yet has developed a new tool dlite to eliminate this pain. He uses a lightweight Linux distribution, DhyveOS, that is small but fast. It will take you about 10 minutes to get started with Docker on Mac.

I didn't see any user guide. So I thought I will write one.

Installing it is easy. Use homebrew.

brew install dlite

Now you can install dlite.

sudo dlite install

If it gives error about authorised keys, it means you don't have authorised_keys under ~/.ssh directory.

Use these commands to create authorised keys.

mkdir ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa -C "Enter an optional comment about your key"

It will ask for passphrase. You will have to enter the passphrase twice.

You got the keys. You have to copy the keys to authorized_keys. Copy it with the following command:

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

Now sudo dlite install should create the base image and also create entries to launch dlite automatically. If all went well, you will see these output.

Building disk image: done
Downloading OS: done
Writing configuration: done
Creating launchd agent: done

Now that dlite is installed, go ahead and start it.

dlite start

dlite creates and boots up a VM. You can connect to the docker VM using ssh [email protected].

Cool thing about dlite is that it mounts the /Users directory inside the VM. So you can access the entire disk inside docker VM.

Go ahead and use docker inside the VM.

Want to update dlite? It is easy.

dlite stop
dlite update
dlite start

Want to delete it? That is easy too.

sudo dlite uninstall
sudo rm /var/run/docker.sock

Thank Nathan for making it easy to use docker easy on Mac.

References:


Comments

comments powered by Disqus