Archiv der Kategorie: Docker

all arround docker-io and docker repositorys

Opencontainer runc on Ubuntu 14.04


running golang with golang path set and golang-bin path set … okay refresh here, if not yet done

## create a working directory

mkdir -pv ~/gocode/

vim ~/.profile

## add this two lines

export GOPATH=/home/tbade/gocode

export PATH=$PATH:$GOPATH/bin

## check out also FIX 2 down below (to install latest Golang)

The normal way of using runC …

# create a ‚‘ in your GOPATH
git clone
cd runc
sudo make install

I had some Issues with Linux Mint17 and Ubuntu 14.04, while building runc … and a small workaround fo fix it:

tbade@torbuntu:~/gocode/$ make
go build -o runc .
checkpoint.go:11:2: cannot find package „“ in any of:
/usr/lib/go/src/pkg/ (from $GOROOT)
/home/tbade/gocode/ (from $GOPATH)
spec_linux.go:13:2: cannot find package „“ in any of:
/usr/lib/go/src/pkg/ (from $GOROOT)
/home/tbade/gocode/ (from $GOPATH)
restore.go:13:2: cannot find package „“ in any of:
/usr/lib/go/src/pkg/ (from $GOROOT)
/home/tbade/gocode/ (from $GOPATH)
spec_linux.go:15:2: cannot find package „“ in any of:
/usr/lib/go/src/pkg/ (from $GOROOT)
/home/tbade/gocode/ (from $GOPATH)
main_unix.go:5:8: cannot find package „“ in any of:
/usr/lib/go/src/pkg/ (from $GOROOT)
/home/tbade/gocode/ (from $GOPATH)
restore.go:14:2: cannot find package „“ in any of:
/usr/lib/go/src/pkg/ (from $GOROOT)
/home/tbade/gocode/ (from $GOPATH)
make: *** [all] Error 1

FIX Issue 1

tbade@torbuntu:~/gocode/$ cd Godeps/_workspace/src/
tbade@torbuntu:~/gocode/$ ls
Sirupsen codegangsta coreos docker godbus golang syndtr
tbade@torbuntu:~/gocode/$ mkdir opencontainers
tbade@torbuntu:~/gocode/$ cd opencontainers/
tbade@torbuntu:~/gocode/$ git clone
Cloning into ‚runc’…


tbade@torbuntu:~/gocode/$ make
go build -o runc .
Godeps/_workspace/src/ internal compiler error: unknown etype 0/STRUCT
make: *** [all] Error 2

PROBLEM is go version 1.2 / 1.2.1 which is the default in Mint 17/Ubuntu 14.04 (tested on both)
FIX Issue 2

sudo apt-get remove golang golang-tools
sudo su
cd /usr/local/
tar -C /usr/local -xzf go1.4.2.linux-amd64.tar.g
rm go1.4.2.linux-amd64.tar.gz
vim /etc/profile
# put inside:
export PATH=$PATH:/usr/local/go/bin

—- Logout / Login … its working afterwards … —-

But now Docker is to old …
Upgrade to latest Docker

sudo apt-get update -y && sudo apt-get upgrade -y

sudo sh -c „echo deb docker main >/etc/apt/sources.list.d/docker.list“

sudo apt-key adv –keyserver hkp:// –recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

sudo apt-get -y update

sudo apt-get install -y lxc-docker

# now you can check the docker version, it should be more actual version than 1.0.2
Start first runC

docker version

docker pull ubuntu:latest

docker export $(docker create ubuntu) > ubuntu_latest.tar

mkdir rootfs

tar -C rootfs -xf ubuntu_latest.tar

vim config.json

„version“: „0.1.1“,
„platform“: {
„os“: „linux“,
„arch“: „amd64“
„process“: {
„terminal“: true,
„user“: „daemon“,
„args“: [
„env“: [
„cwd“: „“
„root“: {
„path“: „rootfs“,
„readonly“: true
„hostname“: „shell“,
„mounts“: [
„type“: „proc“,
„source“: „proc“,
„destination“: „/proc“,
„options“: „“
„type“: „tmpfs“,
„source“: „tmpfs“,
„destination“: „/dev“,
„options“: „nosuid,strictatime,mode=755,size=65536k“
„type“: „devpts“,
„source“: „devpts“,
„destination“: „/dev/pts“,
„options“: „nosuid,noexec,newinstance,ptmxmode=0666,mode=0620,gid=5“
„type“: „tmpfs“,
„source“: „shm“,
„destination“: „/dev/shm“,
„options“: „nosuid,noexec,nodev,mode=1777,size=65536k“
„type“: „mqueue“,
„source“: „mqueue“,
„destination“: „/dev/mqueue“,
„options“: „nosuid,noexec,nodev“
„type“: „sysfs“,
„source“: „sysfs“,
„destination“: „/sys“,
„options“: „nosuid,noexec,nodev“
„linux“: {
„namespaces“: [
„type“: „process“
„type“: „network“
„type“: „mount“
„type“: „ipc“
„type“: „uts“
„capabilities“: [
„devices“: [

sudo runc

# now you can check if you are inside of runc … with ps

Build with packer qcow2 images (e.g. for OpenStack)

First of all, what is Packer?

Packer is an opensource tool for automated creation of identical machine images
for multiple platforms from a single source configuration. That means OpenStack, Vagrant, VirtualBox, Amazon E2 or even docker container.

Packer handles the different virtualization platforms with the integration of plugins, which are then called by the build scripts for the desired virtualization platform .

So here I use the kvm build environment to build a qcow2 image for my OpenStack environment. Think about it, you can easily build up a Jenkins or Go job for automated builds, integrate a checked out source code and deploy a complete … e.g. Test environment for performance Tests … that’s quite cool … or behind LBaaS … start a new instance in OpenStack from latest stable Release … let’s start …
Build with packer qcow2 images (e.g. for OpenStack) weiterlesen

IRCD inside Docker HowTo

This HowTo is to explain how to install an IRC Server inside of a Docker Container,
for testing purposes I also installed vim (just take a look at the Dockerfile …) but it was
for testing only, you can leave it out.

1. Become root
2. Type in:
docker info (just to see if docker is installed)
if „command not found“ shows up, you have to install docker-io
3. create a new folder to store config files (to copy inside the container) and the Dockerfile
(config file for docker to build images)
mkdir -pv ~/Dockerfiles/ircd
cd ~/Dockerfiles/ircd
create an ircd.conf
(a lot of examples can be found on net, this HowTo should not show,
how to configure ircd, it should show, how to create own Docker Container)

IRCD inside Docker HowTo weiterlesen