Sunday, April 29, 2018

Gitlab on Docker

you can install directly (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:

sudo docker run --detach --hostname --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 --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 , 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/
git add
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: