Official gitea docs are heavily focussed on doing SSH passthrough from the host machine to the docker container. An alternative is to simply run SSH for Gitea on a different port. Though I had some problems getting this docker compose setup to run. This gist contains my setup I finally came up with: It does not require SSH passthrough from the host to the docker container but still offers support to git clone via SSH.
To check if this setup works for you simply follow these steps:
- Place enclosed
docker-compose.ymlin a directory. - Run
docker compose up - Visit
http://localhost:8033/and simply install Gitea with given defaults - Visit
http://localhost:8033/user/sign_upand create user account with usernameexample - Visit
http://localhost:8033/user/settings/keysand add your SSH key - Visit
http://localhost:8033/repo/createand create repository withtestname - Clone repository using
ssh://git@localhost:8034/example/test.git - In the previous step you should be authenticated automatically with your SSH key and get a clone of the empy git repository
- Use this working setup as a base to customize for your needs.