[root@gitlab ~]# ip a
[root@gitlab ~]# hostname
[root@gitlab ~]# vi /etc/selinux/config
[root@gitlab ~]# getenforce
[root@gitlab ~]# setenforce 0
[root@gitlab ~]# getenforce
[root@gitlab ~]# dnf -y update
[root@gitlab ~]# dnf search nginx
[root@gitlab ~]# dnf -y install nginx podman
[root@gitlab ~]# rpm -q podman
[root@gitlab ~]# rpm -q nginx
[root@gitlab ~]# mkdir -p /srv/gitlab /srv/gitlab/data /srv/gitlab/config /srv/gitlab/logs
[root@gitlab ~]# vi /etc/hosts
127.0.0.1 gitlab.reposerver.com
[root@gitlab ~]# export GITLAB_HOME=/srv/gitlab
[root@gitlab ~]# podman run --detach \
> --env GITLAB_ROOT_PASSWORD="SkhB4mHWFRONshW" \
> --hostname gitlab.reposerver.com \
--volume $GITLAB_HOME/logs:/var/log/gitlab \
> --env GITLAB_OMNIBUS_CONFIG="external_url 'http://gitlab.reposerver.com'" \
> --publish 8443:443 --publish 8079:80 --publish 2222:22 \
> --name gitlab \
> --restart always \
> --volume $GITLAB_HOME/config:/etc/gitlab \
> --volume $GITLAB_HOME/logs:/var/log/gitlab \
> --volume $GITLAB_HOME/data:/var/opt/gitlab \
> --shm-size 256m \
> gitlab/gitlab-ce:latest
Select docker.io/gitlab/gitlab-ce:latest
[root@gitlab ~]# vi /etc/nginx/conf.d/gitlab.conf
server {
listen 80;
server_name gitlab.reposerver.com;
location / {
# Backend target server
proxy_pass http://192.168.184.128:8079;
}
}
[root@gitlab ~]# nginx -t
[root@gitlab ~]# systemctl enable nginx
[root@gitlab ~]# systemctl start nginx
[root@gitlab ~]# podman ps -a
In browser, <server_IP:PortNumber>
192.168.184.128:8079
Username or primary email: root
Password: SkhB4mHWFRONshW
Press Skip
==Problem=========
[root@gitlab ~]# podman start gitlab
Problem: unable to start container “cb36cc4…..” invalid argument
systemctl enable podman-restart.service
systemctl start podman-restart.service
==Forget username and Password========
[root@gitlab ~]# podman exec -it gitlab /bin/bash
root@gitlab:/# gitlab-rails console -e production
gitlab(prod)> user = User.find_by(username: 'root')
gitlab(prod)> user.password = 'NewStrongPassword123!'
gitlab(prod)> user.password_confirmation = 'NewStrongPassword123!'
gitlab(prod)> user.save!
gitlab(prod)> User.where(admin: true).pluck(:username, :email) =to check username
No comments:
Post a Comment