Sunday, April 29, 2018

Gitlab on Docker

you can install directly https://about.gitlab.com/installation/#centos-7 (to uninstall: sudo gitlab-ctl stop && sudo gitlab-ctl uninstall && sudo systemctl stop gitlab-runsvdir.service && sudo systemctl disable gitlab-runsvdir.service )


but it's wiser to simply run a docker image:

https://docs.gitlab.com/omnibus/docker/


sudo docker run --detach --hostname gitlab.example.com --publish 7443:443 --publish 7080:80 --publish 7022:22 --name gitlab --restart always --volume /srv/gitlab/config:/etc/gitlab --volume /srv/gitlab/logs:/var/log/gitlab --volume /srv/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce:latest

(I had to change 22 to 2222, since it was already used)

for SELinux (you can disable by sudo vi /etc/selinux/config, then set disabled and reboot... check with sestatus):
sudo docker run --detach --hostname gitlab.example.com --publish 443:443 --publish 80:80 --publish 22: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



then http://127.0.0.1:7080 , give your admin password and register for a new user vernetto

create project vernetto, make it public, create repository pippo, then clone it from bash terminal
git clone http://localhost:7080/vernetto/pippo.git
cd pippo/
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
git remote -v
origin http://localhost:7080/vernetto/pippo.git (fetch)
origin http://localhost:7080/vernetto/pippo.git (push)



No comments: