Rainer Schuermann's picture

Installation and running TurnKey LXC was easy and successful. But I con't figure out where to go from here.

I tried to install gitlab - what I did:

  1. created a /root/inithooks.conf [1]

  2. created the container with
    lxc-create -n gitlab -t turnkey -- gitlab -i /root/inithooks.conf -l natbr0 -x

  3. Started the container
    lxc-start -n gitlab -d

  4. Did the proxy / iptables magic
    nginx-proxy gitlab.servers.homelinux.net gitlab
    host gitlab
    gitlab has address
    iptables-nat add 2222

Logging in through SSH was successful:

  Welcome to Lxc, TurnKey Linux 13.0 / Debian 7.3 Wheezy
  System information (as of Mon Dec 28 19:30:48 2015)
    System load:  0.01             Memory usage:  5%
    Processes:    109              Swap usage:    0%
    Usage of /:   0.1% of 1.60TB   IP address for br0:
                                   IP address for natbr0:

Two probably related problems:

  1. On my router, I direct all port 80 and 443 connections to but will not be able to use my domain to access the gitlab container - keeps connecting and then timeout
  2. Once I restart the LXC machine (and gitlab explicitly), my connection to the container is lost:
    /etc/init.d/nginx restart
    Restarting nginx: nginx: [emerg] host not found in upstream "gitlab" in /etc/nginx/sites-enabled/gitlab.servers.homelinux.net:7
    nginx: configuration file /etc/nginx/nginx.conf test failed
    ssh: connect to host port 22: No route to host

Apologies for newbie question - I really would like to understand. I did my homework and learned a lot about nginx on the way but was not able to extract the answer for my question from the material I found.


[1] inithooks.conf


export APP_EMAIL=webmaster@schuerman.net
export APP_DOMAIN=gitlab.servers.homelinux.net


Jeremy Davis's picture

I use LXC but I must admit that I have spent no time with the TurnKey appliance (it's been on my todo list for over a year now...) I use Proxmox as a hypervisor for my home lab as it includes both KVM (for "proper" vms) and LXC (for Linux containers). I also must admit that I'm lazy and use Proxmox's web UI so even with LXC I don't use commandline generally...

OTTOMH it sounds to me like there is something wrong with the config (but I'm guessing you worked that out already). But without knowing more about the appliance TBH I don't know where to start.

However one thing that has just occurred to me is that GitLab is a massive resource hog. It requires at least 1GB RAM and even then takes quite a while to start. I suggest that you try another appliance (such as LAMP) so you can check whether the issues relate to your LXC host or to the GitLab container. Perhaps much of your issue is just GitLab being slow to start?

Add new comment