https://registry.hub.docker.com/u/phylor/git/dockerfile/
https://github.com/phylor/git-docker
docker repo for git+ssh
can use ubuntu:14.04 as base image:
# === Dockerfile
FROM ubuntu:14.04
RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y ssh git
[install git and ssh]
[ssh === openssh-server + openssh-client ]
...
[ adduser git with home folder /home/git for restricted git shell]
[ create folder /var/run/sshd, set proper permission ]
[ create folder /home/git/.ssh, set proper permission ]
[ create file /home/git/.ssh/authorized_keys, set proper permission]
[ create folder /home/git/repositories]
[ create folder /home/git/git-shell-commands ]
[ copy list, create, start from https://github.com/phylor/git-docker to local,
set proper permission]
# RUN mkdir /keys ?
# VOLUME /keys ?
CMD /start
# ================
$ docker build -t gitssh:t1 .
[ create image from Dockerfile ]
$ docker run -it --rm -v pubkey:/keys -p 3322:22 --name mygitssh gitssh:t1
$ docker inpsect mygitssh|grep IPAddress
$ ssh -v -i -p 22 pubkey git@container_ip
2015年3月12日 星期四
docker image for git+ssh
標籤:
data volume,
docker,
dockerfile,
git,
image,
mount,
repo,
repository,
ssh,
volume
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言