免責聲明

Disclaimer (免責聲明)
繼續閱覽代表您接受以上的免責聲明.
To continue reading means you accept the above disclaimer.

2015年3月12日 星期四

docker image for git+ssh


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




沒有留言:

張貼留言