The best open source code server is github, and an open source implementation is gitlab.
But gitlab is written in ruby, and sometimes there are performance problems.
Sometimes it is super slow when used. Problems will arise when the code is stored too much.
I don't know if gogs will have this problem. So try it.
The code is put on github. More than 1,300 shares.
I use the easiest docker installation. You can install docker directly by installing in centos7. There is in the source.
yum -y install docker
su root # Switch to root user first, then execute the following commands
systemctl enable docker # Automatically start docker at boot
systemctl start docker # start docker
systemctl restart docker # restart dokcer
Otherwise, you also need to install mysql, git, ssh and other services, just toss about it first, don't want to be too troublesome. Even the binary installation is only 15mb.
https://github.com/gogits/gogs/tree/master/docker
# Pull image from Docker Hub.
$ docker pull gogs/gogs
# Create local directory for volume.
$ mkdir -p /var/gogs
# Use `docker run`for the first time.
$ docker run --name=gogs -p 10022:22-p 10080:3000-v /var/gogs:/data gogs/gogs
# Use `docker start`if you have stopped it.
$ docker start gogs
You can see the service using docker ps:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a42d410293e4 gogs/gogs "docker/start.sh /bin"17 seconds ago Up 8 seconds 0.0.0.0:10022->22/tcp,0.0.0.0:10080->3000/tcp gogs
After that, I waited. I wrote about the use of docker domestic mirrors:
You need to register a daocloud account and set the source.
Enter the ip and port of the docker host (default port 10080): http://192.168.1.8:10080/
For simple installation, the sqlite3 database is used. Normally, you should use docker to install a mysql service, and then configure the user name and password.
The default configuration, note that the server ip or domain name must be written.
There is no need to create an administrator user, the first user is the administrator by default.
But the user admin cannot be used.
Created a gogs user, this is the administrator.
The data is under the /var/gogs/ directory on the host. If you need to reinstall, clear this directory, and then restart the docker image of gogs.
Create a project:
Download and submit a file:
# git clone http://192.168.1.8:10080/gogs/gogs.git
# touch README.md
# git add README.md
# git commit -m "first commit"
# git push -u origin master
If ssh is not configured, you need to enter the username and password:
Username for'http://192.168.1.8:10080': gogs
Password for'http://[email protected]:10080':
Counting objects:3, done.
Writing objects:100%(3/3),206 bytes |0 bytes/s, done.
Total 3(delta 0), reused 0(delta 0)
To http://192.168.1.8:10080/gogs/gogs.git
*[ newbranch] master -> master
Branch master set up to track remote branch master from origin.
Then the empty file is uploaded! !
The gogs code is very small, the binary code is only 18mb. high speed.
There are not too many redundant functions, compared to gitlab, it still looks simple. But this problem is not big, the more features the more problems, as long as the git service is done well, other fancy things are useless.
It is enough to do code hosting services. Before gitlab, there is no visual interface when the code is placed on the svn server, as long as the configuration files are different.
It's already very good. It's fast and stable enough. The rest are clouds.
To install Docker for the first time, it is possible to run the docker command, such as
[ html]view plaincopy
After restarting the system, the following error was reported after running docker ps:
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
After searching the information, I realized that this is a permission issue. Need root user to run.
Starting from 0.5.2, the docker daemon always runs as the root user. The docker daemon is bound to a Unix socket instead of a TCP port. Unix sockets belong to the root user by default, so sudo must be added when using docker.
Starting from 0.5.3, create a group named docker, and then add users to this group. When the docker daemon starts, it will grant the Unix read and write permissions to the docker group. In this way, when you use the docker client as a user in the docker group, you don't need to use sudo.
The following is the solution:
The first:
Run the following commands in turn, jump to the root user to run the docker command:
[ html]view plaincopy
The second type:
Add the current user to the docker user group:
[ html]view plaincopy
[ html]view plaincopy
sudo service docker restart
Restart the system and run the docker command directly without adding sudo.
G
M
T
Detect languageAfrikaansAlbanianArabicArmenianAzerbaijaniBasqueBelarusianBengaliBosnianBulgarianCatalanCebuanoChichewaChinese (Simplified)Chinese (Traditional)CroatianCzechDanishDutchEnglishEsperantoEstonianFilipinoFinnishFrenchGalicianGeorgianGermanGreekGujaratiHaitian CreoleHausaHebrewHindiHmongHungarianIcelandicIgboIndonesianIrishItalianJapaneseJavaneseKannadaKazakhKhmerKoreanLaoLatinLatvianLithuanianMacedonianMalagasyMalayMalayalamMalteseMaoriMarathiMongolianMyanmar (Burmese)NepaliNorwegianPersianPolishPortuguesePunjabiRomanianRussianSerbianSesothoSinhalaSlovakSlovenianSomaliSpanishSundaneseSwahiliSwedishTajikTamilTeluguThaiTurkishUkrainianUrduUzbekVietnameseWelshYiddishYorubaZulu | AfrikaansAlbanianArabicArmenianAzerbaijaniBasqueBelarusianBengaliBosnianBulgarianCatalanCebuanoChichewaChinese (Simplified)Chinese (Traditional)CroatianCzechDanishDutchEnglishEsperantoEstonianFilipinoFinnishFrenchGalicianGeorgianGermanGreekGujaratiHaitian CreoleHausaHebrewHindiHmongHungarianIcelandicIgboIndonesianIrishItalianJapaneseJavaneseKannadaKazakhKhmerKoreanLaoLatinLatvianLithuanianMacedonianMalagasyMalayMalayalamMalteseMaoriMarathiMongolianMyanmar (Burmese)NepaliNorwegianPersianPolishPortuguesePunjabiRomanianRussianSerbianSesothoSinhalaSlovakSlovenianSomaliSpanishSundaneseSwahiliSwedishTajikTamilTeluguThaiTurkishUkrainianUrduUzbekVietnameseWelshYiddishYorubaZulu |
---|
Text-to-speech function is limited to 200 characters
Options : History : Feedback : Donate | Close |
---|
Recommended Posts