6. GITLab

6.1. Install

Warning

Machine must have at least 2 GB RAM, otherwise freezes. Amazon t2.micro is not good.

$ mkdir -p /home/gitlab
$ chmod 777 /home/gitlab
$ docker run \
    --name gitlab \
    --detach \
    --restart always \
    --rm \
    --hostname gitlab.example.com \
    --network ecosystem \
    --publish 2222:22 \
    --publish 2280:80 \
    --publish 22443:443 \
    --volume /home/gitlab/config:/etc/gitlab \
    --volume /home/gitlab/logs:/var/log/gitlab \
    --volume /home/gitlab/data:/var/opt/gitlab \
    gitlab/gitlab-ce:latest

6.1.1. Run from docker-compose

Listing 6.1. gitlab.yaml
version: '3'

networks:
    ecosystem:
        driver: bridge

services:
    gitlab:
        image: gitlab/gitlab-ce
        container_name: gitlab
        hostname: gitlab.example.com
        restart: "always"
        ports:
            - "2222:22"
            - "2280:80"
            - "22443:443"
        networks:
            - ecosystem
        volumes:
            - /home/gitlab/config:/etc/gitlab
            - /home/gitlab/logs:/var/log/gitlab
            - /home/gitlab/data:/var/opt/gitlab
docker-compose -f gitlab.yaml up

6.2. Configuration

$ docker exec -it gitlab vi /etc/gitlab/gitlab.rb
$ docker restart gitlab

6.3. Login

Warning

Username do zalogowania to root