- Docker on Ubuntu
- Gitlab container with Mailgun mailing support
- nginx reverse-proxy with docker-gen
from http://jasonwilder.com/blog/2014/03/25/automated-nginx-reverse-proxy-for-docker/
# Install docker-gen command-line tool
wget https://github.com/jwilder/docker-gen/releases/download/0.3.1/docker-gen-linux-amd64-0.3.1.tar.gz
tar xvzf docker-gen-linux-amd64-0.3.1.tar.gz
mv ./docker-gen /usr/bin/
# Fetch docker-gen related config files
curl -L https://gist.githubusercontent.com/uetchy/065766a85bd08fa95b07/raw/e57720805961b4f60a7db583ca14df7003af09c1/docker-gen.conf -o /etc/init/docker-gen.conf
curl -L https://gist.githubusercontent.com/uetchy/065766a85bd08fa95b07/raw/f893cb431b4a3353712dcdb9fad25188f55e8bee/docker-gen.cfg -o /etc/docker-gen.cfg
curl -L https://gist.githubusercontent.com/uetchy/065766a85bd08fa95b07/raw/985ca0e234843964116867dc63e325edce08cc0d/docker-gen.tmpl -o /etc/nginx/docker-gen.tmpl
# Start docker-gen by Upstart
start docker-gen
If it was given VIRTUAL_HOST when launching Docker container, docker-gen provides reverse-proxy configration for the container exposes ip and port into /etc/nginx/conf.d/docker-gen.conf
$ mkdir -p /etc/init/docker
env container_name="gitlab"
description "Docker container-name"
author "uetchy"
start on filesystem and started docker
stop on runlevel [!2345]
respawn
script
/usr/bin/docker start -a $container_name
end script
username: [email protected]
password: 5iveL!fe
# Pulling Gitlab image
docker pull sameersbn/gitlab:latest
# Launch Gitlab container with following options
DOCKER_GITLAB_HOST=git.example.com
docker run --name gitlab -d \
-v /opt/gitlab/data:/home/git/data \
-v /opt/gitlab/mysql:/var/lib/mysql \
-p 22:22 \
-h $DOCKER_GITLAB_HOST \
-e "VIRTUAL_HOST=$DOCKER_GITLAB_HOST" \
-e "GITLAB_HOST=$DOCKER_GITLAB_HOST" \
-e "GITLAB_EMAIL=gitlab@$DOCKER_GITLAB_HOST" \
-e "GITLAB_SUPPORT=support@$DOCKER_GITLAB_HOST" \
-e "SMTP_DOMAIN=$DOCKER_GITLAB_HOST" \
-e "SMTP_HOST=smtp.mailgun.org" \
-e "SMTP_USER=postmaster@$DOCKER_GITLAB_HOST" \
-e "SMTP_PASS=password" \
sameersbn/gitlab:latest
from https://github.com/uetchy/docker-jenkins
# Pulling Jenkins imaage
docker pull uetchy/jenkins
# Install Jenkins plugins into /opt/jenkins first
docker run -it \
-v /opt/jenkins:/jenkins \
-e "JENKINS_PLUGINS=simple-theme-plugin greenballs credentials ssh-credentials ssh-agent git-client git scm-api postbuild-task gitlab-hook gitlab-merge-request-jenkins" \
uetchy/jenkins plugins:install
# Launch Jenkins container with following options
docker run -d --name=jenkins \
-v /opt/jenkins:/jenkins \
-e "VIRTUAL_HOST=ci.example.com" \
uetchy/jenkins
docker pull uetchy/ngircd
docker run --name ngircd -d \
-p 6667:6667 \
-e "NGIRCD_NAME=irc.example.com" \
-e "NGIRCD_INFO=The internal irc server" \
-e "NGIRCD_PASSWORD=password" \
-e "NGIRCD_MOTD_PHRASE='Welcome home!'" \
uetchy/ngircd