Install LXC:
apt-get install linux-hwe-generic # update to 3.13 on Precise
apt-add-repository ppa:ubuntu-lxc/stable
apt-get update
apt-get install lxc lxc-templates cgmanager cgroup-lite
reboot
Create Ubuntu container
lxc-create -n gitlab -t ubuntu-cloud \
-B lvm --vgname sdbvg --fssize 3G \ # optional, use LVM
-- -r precise -s daily # optional, use 12.04 with latest updates
# add
# -T https://cloud-images.ubuntu.com/precise/20140821/precise-server-cloudimg-amd64-root.tar.gz
# in case lxc-create cannot find ubuntu-cloudimg-query or do
# apt-get install cloud-utils
lxc-start -n gitlab -d
lxc-ls -f # add 'IP gitlab.lxc' to /etc/hosts
lxc-attach -n gitlab
Inside the container
apt-get install openssh-server postfix
wget https://downloads-packages.s3.amazonaws.com/ubuntu-12.04/gitlab_7.1.1-omnibus.1-1_amd64.deb
dpkg -i gitlab_7.1.1-omnibus.1-1_amd64.deb
nano /etc/gitlab/gitlab.rb
# external_url 'http://gitlab.lxc'
gitlab-ctl reconfigure
Open http://gitlab.lxc and login with user / pass: root / 5iveL!fe
(openSUSE host is used because zypper
is required to bootstrap rootfs)
Install LXC
zypper rm lxc
zypper ar http://download.opensuse.org/repositories/Kernel:/stable/standard/Kernel:stable.repo
zypper ar http://download.opensuse.org/repositories/Virtualization/openSUSE_13.1/Virtualization.repo
zypper dup --from Kernel_stable
zypper in lxc build
cat >/etc/lxc/default.conf <<EOF
lxc.network.type = veth
lxc.network.link = br0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:xx:xx:xx
EOF
yast
# create br0 bridge, attach it to eth0, and move IP config to br0
systemctl enable lxc
reboot
Create openSUSE container
lxc-create -n gitlab -t opensuse
lxc-start -n gitlab -d
lxc-ls -f # add 'IP gitlab.lxc' to /etc/hosts
lxc-attach -n gitlab
Inside the container
zypper in wget less timezone
wget http://downloads.bitnami.com/files/stacks/gitlab/7.1.1-0/bitnami-gitlab-7.1.1-0-linux-x64-installer.run
chmod +x bitnami-gitlab-*.run
./bitnami-gitlab-*.run
# answer gitlab.lxc to Domain question
Open http://gitlab.lxc and login.
In case the host itself is running under some kind of virtualization, then container won't be able to receive IP address from DHCP with default settings. Go to network adapter options and allow Promiscuous Mode (link). Bridged mode is also recommended for simplicity.