jkarlosb / git-server-docker Goto Github PK
View Code? Open in Web Editor NEWGit Server in Docker
Git Server in Docker
##As an alternative to typical SSH auth, we'd have use for authentication via a cookie file.
This engages the http.cookiefile option of git config
.
More specifically, we'd like to do so in the context of the git-sync package, which sets the http.cookiefile via the command: (see line 679)
git config --global http.cookiefile [PATH/TO/COOKIEFILE]
Is there current support for this?
Thank you!
It's not mentioned in the README, but is it possible to read the content of one of the repos (f.e. master branch) in the volume? F.e. to reuse the volume for another container that uses that content, like a Hugo or just nginx?
I'm getting "my repo does not exist"... tearing my hair out, can you give any troubleshooting tips?
-I can ssh and get the msg "...but i do not provide interactive shell" (so key is good)
-I can "docker exec -it hash /bin/sh" and see /git-server and subs keys and repos, files inside etc
(so my volumes are good and are visible from inside container, and i see "myrepo")
-When i do a "git clone --mirror [email protected]:222/git-server/repos/myrepo ." from home, i get
..."does not exist"
(In below, i am using port 222 on purpose... 22 and 2222 already used...)
-When i do a "git clone ssh://[email protected]:222/git-server/repos/myrepo", i get...
"Cloning into 'myrepo'...
[email protected]: Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
-Is there ANY way to list from remotely? or a way to get it to go interactive to test?
I know i'm SO CLOSE, but not sure why it's not working...
-I did see the post "permission Error when trying to do: git push"
fix: (tried... didn't work for me)
/git-server/repos # sudo chmod -R ug+w .;
Thanks so much for any help...
Noobs question: Your Readme is great. Got everything working from there. Could you add a paragraph on how to add an additional git user?
I.e.
How to add an additional Git user:
Append the public key of the new git user to the ~/git-server/keys/id_rsa.pub and restart the git server
Such a great way to setup a git. Hope you can help.
Sadly, this project has seen no updates since 2017. I've decided to have a go a packaging a very close solution, which hopefully solves some of the open issues from this project and adds some other useful utilities:
https://github.com/rockstorm101/git-server-docker
Any comments or suggestions, please let me know. Hope you find this useful.
Bash and curl would be useful to implement server-side hooks, e.g. to notify pushes to a webserver. The image overall size won't be affected too much.
I'm trying to use this to push from my web container to the git-server container.
But I can only get it to work by moving the public key into /home/git/.ssh/authorized_keys in the git-server container.
I don't see how else it would work. How is the /git-server/keys used in the sshd_config? Is there something I'm missing?
This might be a stupid question but
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>
What is the user@host here? I'm guessing it relates to the localhost? and the hostname?
Thanks,
Hi, when I try to clone your repository, it asks for my credentials.
I think this is undesirable because I can't use your code in my CI server.
Could you please open it up?
Thanks
when attempting to push changes to upstream I am faced with the following:
git commit -m "init" [master (root-commit) ec6447c] init 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test $ git push Counting objects: 3, done. Writing objects: 100% (3/3), 212 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) remote: error: insufficient permission for adding an object to repository database ./objects remote: fatal: failed to write object error: unpack failed: unpack-objects abnormal exit To git@gitserver:/git-server/repos/runscripts ! [remote rejected] master -> master (unpacker error) error: failed to push some refs to 'git@gitserver:/git-server/repos/runscripts'
I have changed the ownership of the mounted /git-server to the UID of the git user in the container.
Any way to solve this?
As a note, I had to restart the docker container after I copied my key. I'm using the latest tag on MacOS.
If two public keys will uploaded and first key has no newline char at the end of file, then two keys are written in one line in authorized_keys file. Authorization using second key is impossible.
Root cause:
cat /git-server/keys/*.pub > .ssh/authorized_keys
I tried building an image on my ODROID-XU4(armv7).
Docker build failed with the message saying
"docker arm no matching manifest for unknown in the manifest list entries".
It seems that alpine:3.4 has no image for armv7.
Changing "FROM alpine:3.4" to "FROM alpine:latest" results in a successful build.
How about changing alpine tag to 3.7 or later version?
Thank you for your great work.
When I try to scp into the container I get the following error:
fatal: unrecognized command 'scp -f /myfolder'
I guess git-shell
restricts which commands can be run.
How do the scp examples in the documentation work?
Do I need to enable anything to make it work?
Nevermind, seems I forgot that LFS is a client setting. Please close.
I would like to ask question about licence for this project?
I have a git server and everything is in test.git under git home directory. I can not get to the files that have been pushed to it and clone the repo does not get me to the files.
Where are the files located when git push origin master are?
I get the following log entries after launching the container via docker-compose up
:
git-server_1 | /etc/ssh/sshd_config line 80: Unsupported option KerberosAuthentication
git-server_1 | /etc/ssh/sshd_config line 86: Unsupported option GSSAPIAuthentication
host# git push origin master
result:
remote: error: insufficient permission for adding an object to repository database ./objects
fix:
/git-server/repos # sudo chmod -R ug+w .;
Line 14 in 72f69a5
Are you sure you don't want to do this conditionally in start.sh? With this, every container created with this image will have the same ssh host key which is bad.
I have problems connecting from my windows client to this docker git server container. I do -p 2222:22 just like in the readme and added my "ssh-rsa ..." public key to the keys folder.
But when i try to connect to port 2222 with git or tortoiseGit I get the following error
Is there some way to read any logs? I don't get anything back with 'docker-compose logs -t' or 'docker logs git-server' (where git-server is the containers name).
I don't know if my problem is server or client side, I just think I do it the same way on client side as I did it before when connecting to my previous gitlab (Putty Key as private key).
Any idea how to proceed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.