Skip to content

Instantly share code, notes, and snippets.

@dwurf
Last active October 26, 2015 11:42
Show Gist options
  • Save dwurf/c9bb3f46209d444bc69b to your computer and use it in GitHub Desktop.
Save dwurf/c9bb3f46209d444bc69b to your computer and use it in GitHub Desktop.
Docker setup

These steps were run to set up the local network

Docker install

sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo bash -c "echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get -y install docker-engine
sudo docker run hello-world
sudo docker run -it ubuntu bash

Download all required images

This takes a while and downloads a lot of images

sudo docker pull mist/mistio
sudo docker pull quay.io/sameersbn/apt-cacher-ng:latest
sudo docker pull f99aq8ove/gitbucket

Apt-cacher-ng

TODO: yum caching config, tune expiry dates

mkdir -p ~/manage/volumes/apt-cacher-ng

Once the image is running, you can place the following file in /etc/apt/apt.conf.d/10proxy

Acquire::http { Proxy "http://localhost:3142"; };
Acquire::https { Proxy "DIRECT"; };

GitBucket

Once the image is running, login with username root, password root

mkdir ~/manage/volumes/gitbucket-repos

Mist.io

In /etc/default/docker:

DOCKER_OPTS="-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock"

Create and populate the storage volume

if [[ ! -d ~/manage/volumes/mistio/src ]]; then
    mkdir ~/manage/volumes/mistio
    cid=$(sudo docker run -d mist/mistio)
    sleep 2m # Wait until UI is up to ensure mistio is up-to-date
    sudo docker export $cid | tar xv home/mist
    mv home/mist/mist.io/* ~/manage/volumes/mistio/
    rm -rf home/mist/mist.io home/mist && rmdir home
    sudo docker stop $cid
    sudo docker rm $cid
fi
#!/bin/bash
pwd=$(readlink -f $(dirname $0))
# Run mist.io on port 2000
# database and git repo are mounted to an external volume
echo -n "Starting mist.io... "
docker run -d --name mist.io -p 2000:8000 -v "$pwd/volumes/mistio":/home/mist/mist.io mist/mistio ||
docker start mist.io
# Run apt-cacher-ng on port 31280
# package cache is mounted to an external volume
echo -n "Starting apt-cacher-ng... "
docker run -d --name apt-cacher-ng -p 3142:3142 -v "$pwd/volumes/apt-cacher-ng":/var/cache/apt-cacher-ng quay.io/sameersbn/apt-cacher-ng:latest ||
docker start apt-cacher-ng
# Run gitbucket on port 2001
# git repos are mounted to an external volume
# SSH available on standard port 29418
echo -n "Starting gitbucket... "
docker run -d --name gitbucket -p 2001:8080 -p 29418:29418 -v $pwd/volumes/gitbucket-repos/:/gitbucket f99aq8ove/gitbucket ||
docker start gitbucket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment