CentOS 7 install gogs git code server

1 , About Gogs

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.

2 ,installation steps#

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.

3 , Install gogs

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.

4 , Test git service#

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! !

5 ,to sum up#

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.

Cannot connect to the Docker daemon. Is the docker daemon running on this host? Solution.

To install Docker for the first time, it is possible to run the docker command, such as

[ html]view plaincopy

  1. docker ps

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

  1. sudo su //Switch to root
  2. service docker start //Start docker service
  3. docker images //Display all images
  4. docker ps //Rerun the docker command

The second type:

Add the current user to the docker user group:

Add docker user group

[ html]view plaincopy

  1. sudo groupadd docker

Add yourself to the docker user group

[ html]view plaincopy

  1. sudo gpasswd -a myusername docker

Restart the docker background service

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

CentOS 7 install gogs git code server
Centos compile and install Git
install virtualbox on centos server
Install Nginx server on CentOS 7
CentOS 8 install Git and basic configuration
Tencent Cloud Centos7 install java server
CentOS configuration git server in VirtualBox
Tencent Cloud Centos7 install java server
Install Percona Server database (in CentOS 8)
1.5 Install Centos7
CentOS7 install and use SQL Server
CentOS7.5 source code compile and install mysql5.7.29
CentOS7.4 source code compile and install MySQL8.0
Centos6 install Python2.7.13
Centos7.3 install nginx
CentOS7.2 install Mysql5.7.13
CentOS install Redmine
Centos7 install Python 3.6.
CentOS7 install MySQL
Centos7 install protobuf
CentOS 7 install Docker
CentOS7 install GlusterFS
CentOS 7.4 install Zabbix 3.4
CentOS7 install Docker
Centos6.5 install Tomcat
CentOS install Python 3.6
Vmware install CentOS6
centos7 install docker-ce 18.01.0
CentOS 7.2 install MariaDB
CentOS 7 install Hadoop 3.0.0
Centos 7.6 install seleniu
CentOS 7.3 install Zabbix3
CentOS install mysql
CENTOS6.5 install CDH5.12.1 (1)
CentOS6 install mist.io
Centos7 install Docker
CentOS7 install mysql
centOs install rabbitMQ
CentOS 7 install MySQL 5.6
Centos7 install Nginx
CentOS6.5 install CDH5.13
Centos7 install docker18
Centos install Python3
centos7 install docker
CentOS install jdk
centos7 install nginx-rtmp
CentOS8 install MySQL8.0
Centos6.3 install KVM
CentOS install PostgreSQL 9.1
CentOS7 install mysql8
CentOS8 install fastdfs6.06
CentOS 7 install Gitlab
Centos 7 install PostgreSQL
CentOS7 install MySQL8
CentOS 7 install Java 1.8
CentOS 6 install Docker
centos 6.5 install zabbix 4.4
Centos8 install Docker
CentOS6.8 install python2.7
CentOS install nodejs 8
CentOS6.5 install GNS3