common Development infrastructure build step record
This is mainly in the Docker environment to record the development of some of the methods and steps to develop infrastructure, easy to refer to the Nexus Service Gitlab service zookeeper cluster Kafka cluster services API Interface Management Service [Eolinker] bug management platform [Zentao Zen Road] dubbo-admin Background Management Service Docker Modify Source
The default docker pull command to download some base image, is downloaded from a foreign source, often network timeout failure, you can add the configuration of domestic sources, in order to quickly download;
Modify the "registry-mirrors" configuration item in the/etc/docker/daemon.json file
"Registry-mirrors": ["https://registry.docker-cn.com"]
Building Nexus Services
1. Image download
Docker Pull Sonatype/nexus3
2. Start the container service with a Nexus image
Docker run-d-P 8081:8081--name nexus-v/data/nexus:/nexus-data SONATYPE/NEXUS3
3. Access Nexus for service initialization, default administrative user [admin:admin123]
http://localhost:8081/
Gitlab Service [use CE version here]
1. Image download
Docker Pull Gitlab/gitlab-ce
2. To start the container service using Gitlab mirroring
A) Start
sudo docker run--detach \
--hostname 47.104.109.80 \
--publish 8043:443--publish 8082:8082--publish 8,022:8,022 \
--name gitlab \
--restart always \
--volume/data/gitlab/config:/etc/gitlab:z \
--volume/data/ Gitlab/logs:/var/log/gitlab \
--volume/data/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce
b) Where are the data? Local location Container location Usage Description/data/gitlab/config/etc/gitlab for storing the Gitlab configuration The files configuration file/data/gitlab/data/var/opt/gitlab for storing application data storage application, i.e. our code/data/gitlab/logs/var/log/gitla b for storing logs log data, that is, gitlab all log summaries
c) View Log
Gitlab-ctl Tai
3. Configure external access URLs for Gitlab
A) Modify the Gitlab configuration file/data/config/gitlab.rb, add the mailbox service information
External_url ' HTTP/host ip:8082/
gitlab_rails[' gitlab_shell_ssh_port '] = 8022
b) make the configuration effective
Gitlab-ctl Reconfigure
c) Modify the container's listening port to the SSH service and modify the/asserts/sshd_config in the Gitlab container:
Port 8022
4. Configuring the Gitlab Mail Service
A) Modify the Gitlab configuration file/data/config/gitlab.rb, QQ mailbox As an example to add mailbox service information
gitlab_rails[' smtp_enable ' = True
gitlab_rails[' smtp_address '] = "smtp.qq.com"
gitlab_rails[' smtp_port '] = 465
gitlab_rails[' smtp_user_name '] = "hinsteny@qq.com"
gitlab_rails[' smtp_password '] = "xxxxx"
gitlab_ rails[' smtp_domain ' = "smtp.qq.com"
gitlab_rails[' smtp_authentication '] = "Login"
gitlab_rails[' smtp_ Enable_starttls_auto '] = True
gitlab_rails[' smtp_openssl_verify_mode ') = ' peer '
# If Your SMTP server does not Li Ke the default ' from:gitlab@localhost ' can change the ' from ' with this
setting.
gitlab_rails[' gitlab_email_from ' = ' hinsteny@qq.com '
gitlab_rails[' gitlab_email_reply_to '] = ' noreply_ Hin@qq.com '
b) make the configuration effective
Gitlab-ctl Reconfigure
c) Send mail service under test
Go to console
gitlab-rails Consol
//Send Test mail
notify.test_email (' Receiver_email ', ' email_title ', ' Email_ Content '). Deliver_now
Zookeeper Cluster
Kafka Cluster
Business API Interface Management Service [Eolinker]
No official image yet, you need to deploy it yourself in the PHP environment container
1. PHP-FPM image Download
Docker Pull RICHARVEY/NGINX-PHP-FPM
2. Download the Eolinker installation package and unzip it to/data/software/eolinker
Write code here
3. Start the container
Docker run-
e ' webroot=/var/eolinker '
-v/data/eolinker:/var/eolinker-
p 7000:80-p 9001:9000
--name Eolinker-d RICHARVEY/NGINX-PHP-FPM
4. Access to Services
Http://localhost:7000/
Bug Management platform [Zentao Zen Road]
1. Image download
Docker Pull Haha123/zenta
2. To start the container service using Gitlab mirroring
Docker run-d
--restart always-p 7002:80
--name zentao-v/data/zentao:/opt/zbox Haha123/zentao
3. To replace the data source, Zen Road mirroring uses internal mariadb by default, and you can switch to use external data sources to execute scripts in the container by using the following steps/opt/zbox/auth/adduser.sh Add Zen Channel Administrator and then on the Zen Road Home Click Database Management, Enter the authorization information for the administrator above use root/123456 to connect to the database, export the Zentao database to the external database to create the Zentao database, and then import the SQL from the previous export to modify the host/data/zentao/app/zentao/ config/my.php file, the database information can be replaced by external database information; dubbo-admin Background Management Service
Dubbo-admin does not have an official image, it needs to pack the war itself and then deploy it to the TOMCAT8 container.
1. Download the source code and package
git clone https://github.com/apache/incubator-dubbo-ops
cd incubator-dubbo-ops
mvn Clean Compile package
Get Incubator-dubbo-ops/dubbo-admin/target/dubbo-admin-2.0.0.war
2. Modify Dubbo-config file Dubbo-admin-2.0.0.war:/web-inf/dubbo.properties
dubbo.registry.address=zookeeper://127.0.0.1:2181
Dubbo.admin.root.password=root
Dubbo.admin.guest.password=guest
3. Build a deployment image with the modified war package above, in a dockerfile way
Dockerfile
# origin parent from
dockerbase/tomcat8
# auther
maintainer ' hinsteny@gmail.com '
# Add War package file
ADD dubbo-admin-2.0.0.war/usr/local/tomcat/webapps/
# Start service
CMD ["catalina.sh", "Run"]
Build
Docker build-t Hisoka/dubbo-admin:v2.
4. Start Container Service
# Start a ZK
docker run-p 2181:2181--name dubbo-zookeeper--restart always-d Zookeeper
# start dubbo-admin service
D Ocker run-p 8081:8080--name dubbo-admin--link dubbo-zookeeper:zookeeper-d hisoka/dubbo-admin:v2
5. Access Service, login password [root, Root]
http://localhost:8081/dubbo-admin-2.0.0/