轻量级git服务器 Gogs git 服务器搭建
gogs搭建教程:
原文链接:
https://garthwaite.org/docker-gogs.html
内容:
Dockerized Gogs git server and alpine postgres in 20 minutes or less
// under docker
I’ve babysat gitlab omnibus before and it wasn’t any fun. So when a group of volunteer developers decide to rewrite a community website “with devops” I did what is becoming an annual exercise looking for a free many-user private git repo.
Unsatisfied with bitbucket and friends I decided to try docker + gogs.
$ docker pull gogs/gogs
$ docker images gogs/gogs
REPOSITORY TAG IMAGE ID CREATED SIZE
gogs/gogs latest 40ce39eb7c4b 2 weeks ago 81.17 MB
The image is about 81MB and based on Alpine Linux which is perfect, it saves me from forking the repo and doing that myself.
$ docker run --rm --name gogs gogs/gogs
Apr 8 00:03:03 syslogd started: BusyBox v1.24.1
2016/04/08 00:03:03 [W] Custom config ‘/data/gogs/conf/app.ini’ not found, ignore this if you’re running first time
2016/04/08 00:03:03 [T] Custom path: /data/gogs
2016/04/08 00:03:03 [T] Log path: /app/gogs/log
2016/04/08 00:03:03 [I] Gogs: Go Git Service 0.9.15.0323
2016/04/08 00:03:03 [I] Log Mode: Console(Trace)
2016/04/08 00:03:03 [I] Cache Service Enabled
2016/04/08 00:03:03 [I] Session Service Enabled
2016/04/08 00:03:03 [I] SQLite3 Supported
2016/04/08 00:03:03 [I] Run Mode: Development
2016/04/08 00:03:03 [I] Listen: http://0.0.0.0:3000
Apr 8 00:03:03 sshd[31]: Server listening on 0.0.0.0 port 22.
Note that this docker image listens on two ports: gogs on 3000 and ssh on 22. Usually running ssh in a container is considered bad form but in this case we are supporting git-over-ssh. Let’s kill this container and restart it properly.
$ docker stop gogs; docker rm gogs
$ mkdir -p /srv/lxc/gogs/data
$ docker run -d --name gogs \-p 8300:3000 -p 8322:22 -v /srv/lxc/gogs/data:/data gogs/gogs
Let’s take a look at that web service: open http://vault:8300 gogs start page
Things are going so well at this point that I feel emboldened - what is it like running postgres in docker nowadays?
$ docker pull postgres
… starts downloading two hundred something MB …
200MB for just a database manager? Not in my digital backyard. A search for docker alpine postgresturns up kiasaki/alpine-postgres in not one but practically all of the results.
$ docker pull kiasaki/alpine-postgress
$ docker images kiasaki/alpine-postgres
REPOSITORY TAG IMAGE ID CREATED SIZE
kiasaki/alpine-postgres latest b58856735da8 5 weeks ago 22.69 MB
The docker hub page for kiasaki/alpine-postgres shows how to start the image:
$ mkdir -p /srv/lxc/postgres/data
$ docker run -d --name postgres \-e POSTGRES_PASSWORD=supersecret \-v /srv/lxc/postgres/data:/var/lib/postgresql/data \-p 5432:5432 kiasaki/alpine-postgres$ docker ps -s | grep postgres
b33cf374af70 kiasaki/alpine-postgres “/docker-entrypoint.s” 7 minutes ago
Up 7 minutes 0.0.0.0:5432->5432/tcp postgres 48 B (virtual 22.69 MB)
22 MB < 200 MB and stack-smashing protection for postgres to boot.
At this point we could spin up the gogs container and use the postgres superuser but lets see how we go about administrating postgres without installing psql.
$ docker exec -it postgres psql -U postgres
psql (9.4.6, server 9.5.1)
WARNING: psql major version 9.4, server major version 9.5.Some psql features might not work.
Type "help" for help.postgres=# CREATE USER gogs WITH PASSWORD '^go4git&docker';
CREATE ROLE
postgres=# CREATE DATABASE gogs OWNER gogs;
CREATE DATABASE
postgres=# \q
Great now we spin up gogs this time linking it to postgres and data volumes:
$ docker stop gogs; docker rm gogs
$ docker run --link postgres -d --name gogs
-p 8300:3000 -p 8322:22 -v /srv/lxc/gogs/data:/data gogs/gogs
$ open https://vault:8300
Back at the start page select [[postgres]] with user:gogs pass:^go4git&docker I found a hiccup here - after filling in the credentials it created the DB but forwarded my client to localhost:3000 and not vault:8300 (in my case).From here I made an account dang and it was nice enough to pull in my gravatar. I made an empty repo called 'blog' then added http://vault:8300/dang/blog.git as a remote to my existing repo:
$ git remote add gogs http://dang@vault:8300/dang/blog.git
$ git push gogs master
Password for 'http://dang@vault:8300':
Voila! I can make and push branches then turn those into pull requests in gogs. Remember you can peak at the logs of either container:
$ docker logs -f gogs
$ docker logs -f postgres
Suggestions on how better to explore and learn docker are always welcome in the comments.Credits: Thanks to Manuel Carlos Rodriguez for some corrections.
相关文章:

akaze特征匹配怎么去掉不合适的点_SIFT特征点
SIFT特征点图像特征点检测一直是研究的热点,从早期的harris角点检测开始,一直有很多人关注图像特征点的检测。最早人们关注图像中的角点,主要是因为角点能够代表图像中的一些特征。比如,通过检测两幅图像中的角点,可以…

fopen 中 按文本读写与按二进制读写 实例
参考:http://blog.csdn.net/hinyunsin/article/details/6401854 #include <stdio.h>int main(int argc, char *argv[]) {char he[20] "hello world\n";FILE *outfile fopen("t.txt", "wt");fwrite(he, sizeof(char), 20, out…
狼奔代码生成工具使用心得
狼奔代码生成工具(http://ltfwan.d33140.jit8.cn)是一款为程序员设计的代码生成器,更是一款软件项目智能开发平台,它可以自动生成ASP.NET页面及后台代码,采用了面向服务的架构(SOA)。那么,要如何通过狼奔代…

h5在手机端实现简单复制
<a href"https://blog-static.cnblogs.com/files/ruanqin/clipboard.min.js">下载clipborrdjs</a> 下载地址:https://blog-static.cnblogs.com/files/ruanqin/clipboard.min.js html中: <div id"app"> <a hr…

MQTT topic匹配规则
MQTT topic匹配规则 原文连接: https://blog.csdn.net/JiangCheng817/article/details/81333893 内容: 主题层级分隔符 “/”: 表示层级关系 单层通配符 “”: 订阅消息时使用,匹配一层主题如 a/ 匹配诸如 a/b a/c 但是不能匹配 a/b/c,特别的单独的可…

产品经理岗位职责说明_技术负责人岗位职责,五大方面,超越岗位抓住未来才是技术大牛...
技术负责人一般指建设领域、生产制造领域、电子商务领域,负责全过程的技术决策、技术指导。技术负责人的岗位职责包含五个方面:技术职责:负责具体技术方案设计思路、关键参数等技术决策,负责对所有技术人员进行具体技术实施时的技…

Jane Eyre
Do you think I could stay here to become nothing to you? Do you think because I am poor , and obscrue, and plain that I am soulless, and heartless? I have as much soul as you and fully as much heart. And if God gifted me beauty and wealth, I should have …

Ubuntu 10.04 LTS 网站权限不够
wordpress不能自动升级config文件没法写找不到目录wordpress修改无法保存。。。。这些都是权限不够。解决办法:给apache一个访问www目录的权限,一般linux的网站目录是/srv/www/此时用下面的命令:chown www-data:www-data /srv/www/ -r

简单配置nginx反向代理,实现跨域请求
简单配置nginx去做反向代理,实现跨域请求 简单介绍nginx的nginx.conf最核心的配置,去做反向代理,实现跨域请求。 更多详细配置,参考nginx官方文档 先介绍几个nginx命令 打开nginx.conf文件/usr/local/etc/nginx/nginx.conf重新加载…

c# redis hashid如何设置过期时间_Redis中Key过期策略amp;淘汰机制
1. Redis中设置Key过期时间我们有两种方式设置过期时间1.1 设置多久后过期设置一个 key 10s 过期,可以这样127.0.0.1:6379> SET key value EX 10127.0.0.1:6379> SET key value PX 10000PX 后面是毫秒ms,EX是秒。设置完成后,10s内&…

在CISCO路由器上配置DHCP与DHCP中继
企业网络中DHCP环境的搭建 企业DHCP需求描述: 在大型企业中,一般都有很多个部门,各部门之间有时要求不能互通,这可以通过使用VLAN来解决,但是上千个人IP配置也是一件极大耗费人力的事。所以我们迫切需求一种全自动的&a…

MQTT消息长度限制
原文连接: https://stackoverflow.com/questions/34522053/what-is-the-maximum-message-length-for-a-mqtt-broker 内容: 单条消息默认限制大小256MB,可以通过配置修改 It’s not entirely clear what you’re asking here, so I’ll answer both pos…

jQuery EasyUI API 中文文档 - DataGrid 数据表格
扩展自 $.fn.panel.defaults ,用 $.fn.datagrid.defaults 重写了 defaults 。依赖panelresizablelinkbuttonpagination用法1. <table id"tt"></table> 1. $(#tt).datagrid({ 2. url:datagrid_data.json, 3. columns:[[ 4. …

point-to-point(点对点) 网口
点对点连接是两个系统或进程之间的专用通信链路。想象一下直接连接两个系统的一条线路。两个系统独占此线路进行通信。点对点通信的对立面是广播,在广播通信中,一个系统可以向多个系统传输。 点对点通信在OSI协议栈的物理、数据链路层和网络层中定义。 点…

springboot中文文档_登顶 Github 的 Spring Boot 仓库!艿艿写的最肝系列
源码精品专栏中文详细注释的开源项目RPC 框架 Dubbo 源码解析网络应用框架 Netty 源码解析消息中间件 RocketMQ 源码解析数据库中间件 Sharding-JDBC 和 MyCAT 源码解析作业调度中间件 Elastic-Job 源码解析分布式事务中间件 TCC-Transaction 源码解析Eureka 和 Hystrix 源码解…

浏览器缓存网站静态文件
当用户第一次访问你的网站时,让用户的浏览器缓存网站的静态文件,如图片\CSS\JS等,然后接访问接下来的页面就会直接调用浏览器的缓存而不是重新从服务器下载,这样既节省带宽和流量又加快了用户打开网页的速度,一石三鸟,…

MQTT 心跳和keepalive配置
MQTT 心跳和keepalive配置 内容: 正常MQTT 服务器端会配置一个超时时间,一般为60s, 在这个时间段内一个连接如果没有数据传输的话,服务端会主动断开连接以释放资源, 有两种方式可以规避这个问题: 方式1: 最为简单&a…

android开发我的新浪微博客户端-登录页面功能篇(4.2)
上一篇中完成了如上图的UI部分的实现,现在继续来讲功能的实现,用户登录操作主要就是账号列表显示和选择账号登录两个功能其他的都是些简单的辅助功能,首先是点击id为iconSelectBtn的ImageButton时显示用户选择窗口,这个时候去数据…

大脚本运行常见问题总结
1. Allowed memory size of 8388608 bytes exhausted 出现原因:脚本运行超过最大运行时间 解决方法:1 ) 修改 php.ini 文件。将memory_limit 由默认值改成合适的大小,重启服务器。 2)在脚本中加入 ini_set("memory_limit&qu…

MQTT Qos类型解释
MQTT Qos类型解释 原文连接: https://blog.csdn.net/yangguosb/article/details/78653228 内容: Qos0 发送者只发送一次消息,不进行重试,Broker不会返回确认消息。在Qos0情况下,Broker可能没有接受到消息,流程如…

对做技术的一点思考
做技术在中国有没有前途?这个问题是每个在国内做技术的人都会思考的问题。在我看来,我们之所以会产生样的困扰,主要原因在于我们所谓的研发都是二次开发,国内任何公司,研究单位(除开严格保密的单位…

iis伪静态排除css_魔众系统伪静态规则怎么配
魔众系列系统目前已经有大量用户在使用,大家对于伪静态的配置一直有所疑惑,经过和技术小哥哥的协商,我们特意将三种不同的 HTTP 服务器配置文件分享给大家,方便大家参考。魔众系列系统目前已经有大量用户在使用,大家对…

R.drawable 转 bitmap
引用:http://zhidao.baidu.com/question/291703800.html Bitmap bmpBitmapFactory.decodeResource(r, R.drawable.icon); Bitmap newb Bitmap.createBitmap( 300, 300, Config.ARGB_8888 ); Canvas canvasTemp new Canvas( newb ); canvasTemp.drawBitmap(bmp, …

洛谷P3254 圆桌问题(最大流)
题意 $m$个不同单位代表参加会议,第$i$个单位有$r_i$个人 $n$张餐桌,第$i$张可容纳$c_i$个代表就餐 同一个单位的代表需要在不同的餐桌就餐 问是否可行,要求输出方案 Sol 比较zz的最大流 从$S$向$1-m$连流量为$r_i$的边 从$m 1$向$m n$连流…

设置commit 提交模板
设置commit 提交模板 建议提交 (.template)模板文件 放在用户目录(Doceuments)下 (~/Doceuments) 原文连接: https://blog.csdn.net/mafei852213034/article/details/51908049 内容: 1、在根目录建立模板文件 如 xxx_template文件&#…

listen函数的第二个参数_【图像处理】OpenCV系列十七 --- 几何图像变换函数详解(一)...
上一篇我们学习了仿射变换的warpAffine函数,知道了如何用这个函数对图像进行旋转、平移等操作,那么本节我们一起来学习一下与仿射变换相关的其他函数以及相关的几何图像变换。一、convertMaps()函数1、函数原型void convertMaps(InputArray map1, InputA…

flex java socket通信
引用:http://developer.51cto.com/art/201003/189791.htm Java socket通信如何进行相关问题的解答呢?还是需要我们不断的学习,在学习的过程中会遇到不少的问题。下面我们就从源代码中找到有关的问题解决方案。希望大家在以后的Javasocket通信使用中有所收…

编程珠玑:对DAO层的一点修改
由于以前的Domain对象都是不需要序列化的,所以为了操作数据库查询的方便,直接采用继承BaseDomain的方式来完成。这样在传递动态参数的时候,只需要把参数放到Map总,就可以很好的在ibatis配置文件(map.xx来直接获取值)中使用。 这样…

solr 下载 有dist目录的(6需要8)
http://archive.apache.org/dist/lucene/solr/ solr6 需要java8 转载于:https://www.cnblogs.com/hnqm/p/9367140.html

抛出一个nullpointerexception_Java 14 发布了,再也不怕 NullPointerException 了!
推荐阅读:Java程序员danni:就一个HashMap,居然能跟面试官扯上半个小时?zhuanlan.zhihu.com2020年3月17日发布,Java正式发布了JDK 14 ,目前已经可以开放下载。在JDK 14中,共有16个新特性&#…