Docker command finishing

A mounting and pulling gitlab
Docker pull gitlab / gitlab-CE: Latest

二.安装完第一次启动
docker run -d -p 6443:443 -p 6081:80 -p 6022:22
–name gitlab --restart always
–volume /Users/molin/docker/gitlab/config:/etc/gitlab
–volume /Users/molin/docker/gitlab/logs:/var/log/gitlab
–volume /Users/molin/docker/gitlab/data:/var/opt/gitlab
gitlab/gitlab-ce:latest

Parameter Description:
Docker RUN --detach \ -d # # running in the background
-hostname gitlab.example.com \ # Set the host name or domain name
-publish 6443: 443 --publish 6081: 80 --publish 6022: 22 \ # local port mapping
-name gitlab \ mirrored run # gitlab-ce becomes a container, here is the name of the vessel
-restart always \ # set the restart mode, always Representative has been turned on, the server will boot automatically open the
-volume / Users / molin / docker / gitlab / config: / etc / gitlab \ # to map gitlab profile directory to / Users / molin / docker / gitlab / config directory
-volume / Users / molin / docker / gitlab / logs: / var / log / gitlab \ # gitlab of the log file directory is mapped to / Users molin / docker / gitlab / logs directory /
-volume / the Users / Molin / Docker / gitlab / data: / var / opt / gitlab \ # the data gitlab directory mapping files to / Users / molin / docker / gitlab / data directory
gitlab / gitlab-ce: latest # mirrors need to run

After three .Docker installed, it can be two ways to manage docker service (including start, disable, restart, and view the status).
The first: an outer container
1. Start
Docker Start gitlab
2. Disable
Docker STOP gitlab
3. restart
Docker the restart gitlab
4. Check start situation
docker ps

Second: the container via a bash console operator
1. The method of the console into the bash
Docker Exec Expediting IT gitlab bash
2. Start
gitlab-CTL Start
3. Disable
gitlab-STOP CTL
4. Restart
gitlab the restart-CTL
5. The view state
Status-ctl gitlab
6. gitlab.rb modify the configuration file
find / -name gitlab.rb # lookup profile

# Ultimate key to modify several parameters are as follows
// create a project when host http address in gitlab (do not add port)
external_url 'HTTP: // localhost: 6081'
// Create the project when ssh host address in gitlab
gitlab_rails [ ' gitlab_ssh_host '] =' localhost '(do not add port)
#docker RUN when the corresponding port 22 and port mapping 6922
gitlab_rails [' gitlab_shell_ssh_port '] = 6022
# is enabled
gitlab_rails [' smtp_enable '] = to true
#smtp service address
gitlab_rails [ 'smtp_address'] = "smtp.qq.com"
# port
gitlab_rails [ 'smtp_port'] = 465
# you to send messages from the account
gitlab_rails [ 'smtp_user_name'] = "[email protected]"
#-mail password
gitlab_rails [ 'smtp_password The'] = "********"
#-mail server domain name
gitlab_rails [ 'smtp_domain'] = "smtp.qq.com"
# login authentication
gitlab_rails [ 'smtp_authentication'] = "Login"
# 465 use port would configure the following three
gitlab_rails [ 'smtp_enable_starttls_auto'] = to true
gitlab_rails [ 'smtp_tls'] = to true
gitlab_rails [ 'smtp_openssl_verify_mode'] = 'none'
# E-mail you account
gitlab_rails [ 'gitlab_email_from'] = ' [email protected]'

7. After modifying the configuration file so that the file entry into force
gitlab the reconfigure-CTL
8. The closing bash console
exit

III. The new project is pushed onto the gitlab
cd into the project directory (for example, my project directory / User / mo / workspace / myprj path)
cd / User / mo / workspace / myprj
# then execute these commands
git the init
git Remote Origin SSH the Add: // git @ localhost: 6022 / dev / yunweu_dev.git
. the Add git
git the commit -m "New project"
git the Push -u Origin Master
# If the above error this step, namely the implementation of the following line command
git remote set -url origin of your remote address
such as: git remote set-url origin ssh : // git @ localhost: 6022 / dev / yunwei_dev.git
sell cloud host
computer rental hang idle resources to earn money electricity
use of idle computer resources to earn pocket money ( for students, housewives)
online generated outside the chain tool (international Edition)
generated on-line outside the chain tool (Chinese version)

Published 16 original articles · won praise 2 · Views 401

Guess you like

Origin blog.csdn.net/momoringmok/article/details/105038065