Environment to build step
Installation docker
yum -y install docker
Start docker Service
service docker start
Gogs image taken from the docker Kula
docker pull gogs/gogs
Create the appropriate folders
mkdir -p /var/gogs
Create a docker container gogs
docker run --name=gogs -p 10022:22 -p 10080:3000 -v /var/gogs:/data gogs/gogs
installation
Access address: own server ip +: 10080
Remember to fill in the following figure domain name to the local ip or localhost [127.0.0.1] do not fill in port number 10080 (herein referred to issues related to the bottom there is a problem)
Adding an administrator account
Finally, we can visit: own server ip +: 10080
Related Commands
docker start gogs start Gogs in a container
docker ps lists container
Gogs - clone warehouse address issues of local localhost
- After the building had Gogs on your own server I found a problem, I can not get the right to clone the address displayed on the address bar is not localhost ip address of the server, and not on the port number is not detailed in the figure below 10080
solution
Enter docker
docker exec -it gogs /bin/bash #前提是docker start gogs
- Modify the configuration file
cd ~/../data/gogs/conf/
Into the appropriate configuration foldervi app.ini
Edit Profile
Here we only need to modify the [server] following DOMAIN and ROOT_URL change the localhost server host ip
exit 退出docker容器
docker restart gogs 重启
The following error codes with nginx configuration services push
error: RPC failed; result=22, HTTP code = 413
Modify nginx configuration file upload,
client_max_body_size 100M;
server {
listen 80;
autoindex on;
server_name git.imisty.cn;
# 限制单个文件上传大小,或者采用ssl协议
client_max_body_size 100M;
access_log /usr/local/nginx/logs/access.log combined;
index index.html index.htm index.jsp index.php;
#root /devsoft/apache-tomcat-7.0.73/webapps/mmall;
#error_page 404 /404.html;
if ( $query_string ~* ".*[\;'\<\>].*" ){
return 404;
}
location / {
proxy_pass http://127.0.0.1:10080/;
add_header Access-Control-Allow-Origin '*';
}
}
Other related issues
Note that there is a small dip, but also create the container when the container was launched, this time running in the foreground, press Ctrl + C will be interrupted
- Restart the container can be, concerned about the operational state of the container is very easy to find
Acknowledgments
Thank documentation provided by the junior partner
Small indeed fortunate
每一丝灵感都值得被记录,每一笔记录都是成长,每一点成长都值得欢呼
Personal bloggers station: www.imisty.cn
CSDN blog: https://blog.csdn.net/lookinthefog
blog Park: https://imist.cnblogs.com/
Hope to know some tech-savvy small partner, welcome to the Friends link yo