Get the App
SLTechnology News&Howtos  ›  Servers  › 

Docker install gitlab

Shulou Source: shulou.com Published: 2022-06-02 21:58:55 10月22日 Update

1. Pull gitlab image

Command: docker pull gitlab/gitlab-ce

Description: pull gitlab image

two。 View local images

Command: docker images

Description: view the local image repository

3. Create a container and run

Command: docker run-d-p 443 Users/yunshuodeng/Work/hntx/gitlab/config:/etc/gitlab-v / Users/yunshuodeng/Work/hntx/gitlab/logs:/var/log/gitlab-v / Users/yunshuodeng/Work/hntx/gitlab/logs:/var/log/gitlab-v / Users/yunshuodeng/Work/hntx/data:/var/opt/gitlab/gitlab-ce gitlab/gitlab-ce

Description:

#-d: run in the background

#-p: map the internal port of the container to the outside

#-name: naming container name

#-v: Mount the data folder, log, configuration and other folders in the container to the specified directory of the host

4. Configure gitlab

Command: vi / Users/yunshuodeng/Work/hntx/gitlab/config/gitlab.rb

Modify the following parameters:

# configure the access address used by the http protocol

External_url 'http://192.168.2.15:9527'

# configure the access address and port used by ssh protocol

Gitlab_rails ['gitlab_ssh_host'] =' 192.168.199.231'

# this port is the 222nd port mapped by port 22 when run

Gitlab_rails ['gitlab_shell_ssh_port'] = 222

# Port number to listen to at startup

Nginx ['listen_port'] = 9527

# listen for all requests

Nginx ['listen_addresses'] = [' *']

5. Restart gitlab

Command: docker restart gitlab

6. View the startup log

Command: less / Users/yunshuodeng/Work/hntx/gitlab/logs/unicorn/unicorn_stderr.log

Description: start the log, after no error

7. Access address

Http://192.168.2.15:9527/

8. After the access is successful, you can log in. Please learn by yourself for specific use.

Tags: Command port container image configuration address log file folder monitor run success warehouse parameter slogan name background host host data Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Docker Shulou Technology Apple Xiaomi