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.yml
in a directory. - Run
docker compose up
- Visit
http://localhost:8033/
and simply install Gitea with given defaults - Visit
http://localhost:8033/user/sign_up
and create user account with usernameexample
- Visit
http://localhost:8033/user/settings/keys
and add your SSH key - Visit
http://localhost:8033/repo/create
and create repository withtest
name - 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.