Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build private cloud IDE and devops building chain on docker

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to build a private cloud IDE and devops building chain on docker". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Build gitlab on Qunhui docker

I use GitLab Community Edition 11.7.0 of sameersbn/gitlab on dockerhub around 2019.2.2 (in his image, prior to 7.4.3, the image contains all components, and version 7.4.3 contains only core components: nginx, sshd, ruby on rails, sidekiq). Do not download the official gitlab/gitlab-ce, which contains a built-in postgresql database. Takes up too much memory at startup. And it's not orthogonal. Because this image is very large, the external network line is very difficult to download and easy to interrupt, so we can use the method of ss to open a LAN connection on windows. Then configure a proxy server in the Qunhui control panel-> the web interface you are currently using. After that, the download will be much faster, after the download is complete, download redis:latest at the same time, so that postgresql9.5,redis,gitlab images are available. Start the instances of postgresql and redis first.

Open another instance of sameersbn/gitlab, link to postgresql9.5: alias postgresql,redis: alias redisio,80 container port to 8001, because the host Gunhui occupies 80%. Add several environment variables

GITLAB_SECRETS_DB_KEY_BASE=, write freely, GITLAB_SECRETS_SECRET_KEY_BASE=, write GITLAB_SECRETS_OTP_KEY_BASE=, write freely.

When started, gitlab will automatically connect to postgresql and find that the container exits. After checking the log, it is found that FATAL: role "root" does not exist, and there are no root users in the database. This is because the gitlab instance has root check on the database of the postgresql instance and other hard configuration requirements. Do the following: in Qunhui's web version, enter the terminal interface of the postgresql1 instance (click add to automatically open a bash terminal) to create a new root user and assign permissions.

There should be no such error when su-postgrespsqlcreate user root with password' password';ALTER ROLE root WITH SUPERUSER; tries to start again at this time. But quit again, and prompt psql: FATAL: database "gitlabhq_production" does not existCREATE USER gitlab WITH PASSWORD 'password';CREATE DATABASE gitlabhq_production OWNER gitlab;GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production TO gitlab;\ Q

Finally started successfully, found that memory maintained at 1G much less than gitlab/gitlab-ce, open Qunhui ip:8001, will prompt you to change the password of root, this root is gitlab users, not postgresql. Log in with root and this password and enter Qunhui ip:8001/admin/.

Now you can display localhost on the interface for creating repo,clone above. You need to add two additional startup environment parameters to customize the section shown here as localhost. In addition, if you want to export all kinds of volumes, please refer to ellie's handling method of permissions.

Finally, then go to admin/runners to check a token, standby.

Install gitlab ci for docker on Qunhui docker

There are a lot of holes here.

First of all, do not download sameersbn/gitlab-ci-multi-runner:latest (gitlab/gitlab-runner is also multi). This version is too old. After startup, link to a first step installed gitlab instance alias gitlab. The runner of sameersbn can be registered by defining environment variables.

RUNNER_TOKEN: the above tokenCI_SERVER_URL: http://link to the gitlab alias: 80 to the host forwarding port / ciRUNNER_DESCRIPTION: casually enter RUNNER_EXECUTOR: this temporarily enter shell first

Although convenient, I have tried that this method does not work at all in the above sameersbn/gitlab-ci-multi-runner version, always prompting 404 Failed to register this runner panic. 404,PANIC: Failed to register this runner. Perhaps you are having network problems

We download the same version of gitlab/gitlab-runner:v11.7.0 as gitlab, start link to the gitlab alias gitlab installed in the first step, and then go to the terminal to register runner to CI by command line:

If you create a new bash as in the previous method, you will enter / home/gitlab_runner, and typing gitlab-runner register will prompt you to enter parameters for six options. The order is as follows:

Url: fill in http://gitlab/ciregistration-token: this is the first step to get the spare tokenexecutor. Fill in dockerdocker-image here. I can fill in alpine:3 as needed. What's so particular about this? Why do you choose this one? What's the use of the preset? In fact, this is the image name entered when building Docker image, specifying different images according to the code language of the project. Description, fill in tag-list casually. Here, fill in v1170.

So you can see that in the future, the trigger of devops is mainly triggered by the tags corresponding to here. The principle of docker ci build is to take a certain docker image as a virtual machine, build a fs layer by layer, and then stack it into a final image, and the docker-img here is that virtual machine.

So the combination of docker image and tag can define multiple uses for many different purposes.

That's all for "how to build a private cloud IDE and devops build chain on docker". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report