-
Notifications
You must be signed in to change notification settings - Fork 22
Description
@cirocosta If you're reading this please revert to your :formatting tag on Dockerhub. It may just save lives.
As for anyone else:
I will save you a LOT of time through reading this. I struggled for 2 full days to get a http git server running on docker (from building it yourself, to looking for others who have). I now know git and nginx in and out, but at the cost of a huge dent in my desk from where my forehead made contact multiple times.
Both when I built it myself from scratch as well as when I tried using this Dockerimage, I kept running into 502/504 errors which meant nginx was timing out when trying to pass to the FCGI socket.
I tried literally everything possible to try and fix/debug, and finally narrowed it down to alpine linux having been updates, and with that the fcgiwrap package was updated and broke for the use case of setting up a git http server.
But I finally found a solution: Revert alpine to a version before 2018. You can see the alpine version history here: https://github.com/docker-library/official-images/commits/master/library/alpine
And also check what versions of packages APK offers per version of alpine: https://pkgs.alpinelinux.org/packages?name=spawn-fcgi&branch=v3.5
Or, if like me you're completely beat by hours upon hours wasted:
- Create your repositories folder beforehand using your regular host user (avoid root as it causes issues), and mount it to the container.
- USE "circosta/gitserver-http:formatting" as the image to run from. The :formatting tag is the last version that was working, and
docker run -it --name omgItFinallyWorks -v $PWD/repositories:/var/lib/git -p 9000:80 circosta/gitserver-http:formatting
And from there you can add authentication, SSL, etc by modifying the nginx config.
Toss a coin to your code-fixer