Quickly deploy GitLab with Docker

Put the elephant in the refrigerator, a total of three steps!

Deploying GitLab with Docker is just one step away!

Directly on the command:

sudo docker run --detach \
    --hostname 172.16.64.245 \
    --publish 80:80 \
    --name gitlab \
    --restart always \
    --volume /opt/gitlab/config:/etc/gitlab \
    --volume /opt/gitlab/logs:/var/log/gitlab \
    --volume /opt/gitlab/data:/var/opt/gitlab \
    gitlab/gitlab-ce:10.7.0-ce.0

Parameter description: --detach means the container runs in background mode

                  --hostname host name, if the host has a domain name, write the domain name directly, if there is no domain name, write the IP 

                  --publish 80:80 means to map port 80 of the host to port 80 of the container (the host is before the colon)

                  --name name whatever you want

                  --restart always means to restart the container as soon as it exits

                  --volume represents mapping the host directory to the container directory (the host is before the colon)

In this way, the started GitLab can access GitLab through the IP address of the host, address: http://<host IP>

The first time you use it, you will set a password, and then use root/<the password you set> to log in

Since we use the host to persist GitLab data, restarting will not cause data loss, so feel free to use it!  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325853084&siteId=291194637