• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

jkarlosb/git-server-docker: Git Server in Docker

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

jkarlosb/git-server-docker

开源软件地址:

https://github.com/jkarlosb/git-server-docker

开源编程语言:

Shell 100.0%

开源软件介绍:

git-server-docker

A lightweight Git Server Docker image built with Alpine Linux. Available on GitHub and Docker Hub

"image git server docker" "git server docker"

Basic Usage

How to run the container in port 2222 with two volumes: keys volume for public keys and repos volume for git repositories:

$ docker run -d -p 2222:22 -v ~/git-server/keys:/git-server/keys -v ~/git-server/repos:/git-server/repos jkarlos/git-server-docker

How to use a public key:

Copy them to keys folder: 
- From host: $ cp ~/.ssh/id_rsa.pub ~/git-server/keys
- From remote: $ scp ~/.ssh/id_rsa.pub user@host:~/git-server/keys
You need restart the container when keys are updated:
$ docker restart <container-id>

How to check that container works (you must to have a key):

$ ssh git@<ip-docker-server> -p 2222
...
Welcome to git-server-docker!
You've successfully authenticated, but I do not
provide interactive shell access.
...

How to create a new repo:

$ cd myrepo
$ git init --shared=true
$ git add .
$ git commit -m "my first commit"
$ cd ..
$ git clone --bare myrepo myrepo.git

How to upload a repo:

From host:
$ mv myrepo.git ~/git-server/repos
From remote:
$ scp -r myrepo.git user@host:~/git-server/repos

How clone a repository:

$ git clone ssh://git@<ip-docker-server>:2222/git-server/repos/myrepo.git

Arguments

  • Expose ports: 22
  • Volumes:
  • /git-server/keys: Volume to store the users public keys
  • /git-server/repos: Volume to store the repositories

SSH Keys

How generate a pair keys in client machine:

$ ssh-keygen -t rsa

How upload quickly a public key to host volume:

$ scp ~/.ssh/id_rsa.pub user@host:~/git-server/keys

Build Image

How to make the image:

$ docker build -t git-server-docker .

Docker-Compose

You can edit docker-compose.yml and run this container with docker-compose:

$ docker-compose up -d



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap