Install
https://docs.gitlab.com/omnibus/docker/README.html
hostnamectl set-hostname cicd.example.com
getenforce
Enforcing
Because of selinux
sudo docker run --detach \
--hostname gitlab.example.com \
--publish 30443:443 --publish 30080:80 --publish 30022:22 \
--name gitlab \
--restart always \
--volume /srv/gitlab/config:/etc/gitlab:Z \
--volume /srv/gitlab/logs:/var/log/gitlab:Z \
--volume /srv/gitlab/data:/var/opt/gitlab:Z \
gitlab/gitlab-ce:latest
switch to user admin
visudo
usermod -aG docker admin
id admin
sudo su - admin
GitLab config
to acccess gitlab's configuration file. you can start shell session in the context of a running container. This will allow you to browse all directory and use your favarite text editor
sudo docker exec -it gitlab /bin/bash
you can also just edit /etc/gitlab/gitlab.rb
sudo docker exec -it gitlab vi /etc/gitlab/gitlab.rb
sudo docker restart gitlab
sudo docker stop gitlab
sudo docker rm gitlab
Upgrade Gitlab to newver version
sudo docker restart gitlab
sudo docker stop gitlab
sudo docker rm gitlab
sudo docker pull gitlab/gitlab-ce:latest
sudo docker run --detach \
--hostname gitlab.example.com \
--publish 30443:443 --publish 30080:80 --publish 30022:22 \
--name gitlab \
--restart always \
--volume /srv/gitlab/config:/etc/gitlab:Z \
--volume /srv/gitlab/logs:/var/log/gitlab:Z \
--volume /srv/gitlab/data:/var/opt/gitlab:Z \
gitlab/gitlab-ce:latest
80 \(HTTP\)
443 \(if you configure HTTPS\)
8080 \(used by Unicorn\)
22 \(used by the SSH daemon\)