Differences between revisions 8 and 9
Revision 8 as of 2022-08-17 18:31:03
Size: 1467
Editor: Praveen A
Comment:
Revision 9 as of 2024-02-03 21:26:50
Size: 2171
Editor: Praveen A
Comment: clarify
Deletions are marked like this. Additions are marked like this.
Line 21: Line 21:
{{{#!wiki important
Note: if you are using a virtual machine, make sure it has at least 4GB ram and 4GB swap space to comfortably run the webpack command during installation.
}}}

{{{#!wiki important
Note: You may also use [[Packaging/Pre-Requisites/nspawn|systemd-nspawn]] for creating the container.
}}}
Line 26: Line 34:
 1. During installation, choose `gitlab.lxc` as the hostname
 1. Disable https in debconf wizard
 1. After installation is complete, add ip address of container (`ip a` will list the ip address) in host machine's `/etc/hosts` to resolve gitlab.lxc. `192.168.122.104 gitlab.lxc # Change ip address`
 1. During installation, choose `gitlab.lxc` as the hostname. Note: This step is very crucial to able to correctly access the web interface of gitlab. The name you give here has to be present in `/etc/hosts` of the host system (see below). If you choose `localhost` or miss the step below, you will get the default nginx page instead of gitlab.
 1. Disable https in debconf wizard as we can't get a certificate without a public IP and registered domain name.
 1. After installation is complete, add ip address of container (`ip a` will list the ip address) in host machine's `/etc/hosts` to resolve `gitlab.lxc` to that of the container. `192.168.122.104 gitlab.lxc # Change ip address`

Create the container,

# lxc-create -n gitlab -t debian -- -r unstable

If you host is not debian, use download template lxc-create -n gitlab -t download -- --dist debian --release sid

If you want to create a bullseye container, run lxc-create -n gitlab -t download -- --dist debian --release bullseye or lxc-create -n gitlab -t debian -- -r bullseye

# lxc-start -n gitlab
# lxc-attach -n gitlab

See LXC for more details on managing a container. The steps given below are available as an ansible playbook

Note: if you are using a virtual machine, make sure it has at least 4GB ram and 4GB swap space to comfortably run the webpack command during installation.

Note: You may also use systemd-nspawn for creating the container.

Now inside the container,

You will need a utf-8 locale to install postgresql. Run dpkg-reconfigure locales and choose a locale with utf-8 support (for example en_IN.UTF-8). Reboot the container (reboot command) and run lxc-attach again.

  1. Enable contrib section in /etc/apt/sources.list. apt update && apt install gitlab. Note: when gitlab is broken in ustable, install from experimental following instructions given at gitlab.

  2. During installation, choose gitlab.lxc as the hostname. Note: This step is very crucial to able to correctly access the web interface of gitlab. The name you give here has to be present in /etc/hosts of the host system (see below). If you choose localhost or miss the step below, you will get the default nginx page instead of gitlab.

  3. Disable https in debconf wizard as we can't get a certificate without a public IP and registered domain name.
  4. After installation is complete, add ip address of container (ip a will list the ip address) in host machine's /etc/hosts to resolve gitlab.lxc to that of the container. 192.168.122.104 gitlab.lxc # Change ip address

  5. Visit http://gitlab.lxc on host browser