Docker for Akaros Development

2 views
Skip to first unread message

Kevin Klues

unread,
Jun 16, 2015, 12:06:51 AM6/16/15
to akaros
Hi all,

Given the headaches people seem to go through trying to get a fully
functional development environment setup for akaros, I've taken some
time over the past few days to put together a docker container for
akaros development.

It comes preinstalled with the akaros cross compiler, checked-out
versions of the akaros and go-akaros repos, and a number of useful
tools for working with akaros in general (vim, emacs, qemu-kvm, etc.).

When ran, the docker container will mount a home directory stored on
your workstation, so any work you do inside the container will persist
across invocations (so long as these changes are isolated to your home
directory). All you have to do is set up docker on your workstation
and the scripts contained in this repo take care of the rest.

These scripts basically launch a detached docker container with
hostname 'akaros-devel' that you can ssh into and interact with as if
it was a remote workstation.

Info for installing docker on ubuntu 14.04 can be found at the bottom
of the README associate with the project.

The project itself is hosted at github and can be found here:
https://github.com/klueska/akaros-devel-docker

Let me know if you have any troubles/suggestions for improvements.

Kevin

Yu Zhu

unread,
Jun 16, 2015, 3:07:23 AM6/16/15
to aka...@googlegroups.com
Great! 
In case people want to get this environment set up on their mac os systems, you can try using boot2docker.
It essentially runs a VM with a minimal linux system so you can run docker containers on top of that. 

However, since boot2docker uses a minimalistic coreos image, essential tools such as bash and coreutils needed by kevin's script are missing. 
You need to run the following  before running ./bootstrap 
tce-load -wi bash
tce-load -wi coreutils


Kevin Klues

unread,
Jun 16, 2015, 10:35:38 AM6/16/15
to akaros
Does this require you to first ssh into the boot2docker vm via
'boot2docker ssh'? I assume so, because I know the './bootstrap'
script doesn't work on mac yet. Also, when you do this, I assume you
then clone the akaros-devel-docker repo into the home directory of the
'docker' user inside boot2docker. Are you doing something to make
sure that this stuff persists after boot2docker shuts down (e.g.
'boot2docker down', the machine restarts, etc.)?

I tried playing around with this a bit myself (including getting
things working natively on mac through boot2docker), but was running
into some issues with both the bootstrap script and the mounting of
the home directory. Also, my docker image assumes that it has access
to kvm (because the hardware it runs on supports VTx), but the
tinycore VM that boot2docker is based on doesn't seem to emulate this.

I think it would be great if we could get this wokring natively from
the mac (without no 'boot2docker ssh' necessary). I can send you over
my notes if you have some time and want to try and get this working.

Kevin

Yu Zhu

unread,
Jun 17, 2015, 5:52:54 PM6/17/15
to Kevin Klues, akaros
Yes, this does require 'boot2docker ssh', and I am also using 'boot2docker save' to persist my changes, which I admit is not great. 

I am guessing the proper way to do this is to have an external directory on mac os that is mounted into boot2docker so it persists. 
With boot2docker, I am not sure if we can get around the Vt-x emulation issue, since we would be doing two levels of virtualization on a mac. There simply isn't a good solution to this. 

Of course, another option for mac users is vagrant..which is a VM itself and does not rely on linux containers like docker does. (so not boot2docker necessary)
Feel free to send me what notes you have and I will take a look. 

Barret Rhoden

unread,
Jun 18, 2015, 11:21:06 AM6/18/15
to aka...@googlegroups.com
>From building the docker image, do you have a list of all of the
required software? If so, we can put checks in place in the
toolchain's Makefile. We already have a check for gawk, but we've
mostly just played whack-a-mole over the years.

Kevin Klues

unread,
Jun 18, 2015, 11:35:05 AM6/18/15
to akaros
The docker image is built from the Docker files in the docker
subfolder. Take a look at Dockerfile-pkg-install for a list of the
packages installed.

Barret Rhoden

unread,
Jun 18, 2015, 11:45:29 AM6/18/15
to klu...@eecs.berkeley.edu, akaros
i guess these:

apt-get install -y \
bison \
build-essential \
emacs \
flex \
gawk \
git \
man \
ncurses-dev \
openssh-server \
qemu-kvm \
qemu-system-x86 \
screen \
vim

which ones did you actually need? given that this was driven by
someone not having stuff like bison installed. is the list just:
bison, flex, gawk, and whatever is in build-essential? (gcc / glibc /
binutils?).

anyway, i was hoping you had a handy list of things to add to the top
of tools/compiler/gcc-glibc/Makefile, but if not, then it's not a big
deal.

Kevin Klues

unread,
Jun 18, 2015, 11:49:20 AM6/18/15
to Barret Rhoden, akaros
I would argue you need all of these for a fully functional development
environment (including ncurses for running 'make menuconfig'), but for
the cross compiler itself, that list you put together seems right.
Reply all
Reply to author
Forward
0 new messages