How to build custom docker image #1681

Closed
opened 2025-11-02 04:09:22 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @ilius on GitHub (Apr 5, 2018).

  • Gitea version (or commit ref): 7000b41
  • Git version: 2.15.0
  • Operating system: Ubuntu 16.04.4 LTS (Gitea inside docker 18.03.0-ce)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes
    • No
    • Not relevant
  • Log gist:

Description

We have a test in our go project, that runs 20 clone operations (with go-git) concurrently in different go routines, from the same given repo (and the URL looks like ssh://git@try.gitea.io/ilius/test-repo.git but from our own gitea instance)

Some of those clone operations fail with error in clone: ssh: handshake failed: EOF, and sometimes some of them fail with error in clone: ssh: handshake failed: read tcp IP:PORT->IP:10022: read: connection reset by peer
With try.gitea.io, only the second error (read: connection reset by peer) happens.

They all use the same ssh private key.

Although most of clone operations succeed. But even one failure makes our test fail.

Originally created by @ilius on GitHub (Apr 5, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 7000b41 - Git version: 2.15.0 - Operating system: Ubuntu 16.04.4 LTS (Gitea inside docker 18.03.0-ce) - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes - [ ] No - [ ] Not relevant - Log gist: ## Description We have a test in our go project, that runs 20 clone operations (with go-git) concurrently in different go routines, from the same given repo (and the URL looks like `ssh://git@try.gitea.io/ilius/test-repo.git` but from our own gitea instance) Some of those clone operations fail with `error in clone: ssh: handshake failed: EOF`, and sometimes some of them fail with `error in clone: ssh: handshake failed: read tcp IP:PORT->IP:10022: read: connection reset by peer` With try.gitea.io, only the second error (`read: connection reset by peer`) happens. They all use the same ssh private key. Although most of clone operations succeed. But even one failure makes our test fail.
GiteaMirror added the type/question label 2025-11-02 04:09:22 -06:00
Author
Owner

@lafriks commented on GitHub (Apr 5, 2018):

Could it be OpenSSH server limitation? If so possibly sshd_config needs some option changed.

@lafriks commented on GitHub (Apr 5, 2018): Could it be OpenSSH server limitation? If so possibly sshd_config needs some option changed.
Author
Owner

@lafriks commented on GitHub (Apr 5, 2018):

Could be this: http://www.hypertable.com/documentation/misc/ssh_maxstartups/

@lafriks commented on GitHub (Apr 5, 2018): Could be this: http://www.hypertable.com/documentation/misc/ssh_maxstartups/
Author
Owner

@ilius commented on GitHub (Apr 6, 2018):

To confirm that, I need to modify ssh config inside docker and build my own docker image
I modified "docker/etc/ssh/sshd_config" file, and ran make in docker/ directory. But it gives me this error:

docker build --disable-content-trust=false -t gitea/gitea:latest .
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/ubuntu/go/src/code.gitea.io/gitea/docker/Dockerfile: no such file or directory
Makefile:10: recipe for target 'docker' failed
make: *** [docker] Error 1

Do you have any documentation on how to build my own custom docker image?

@ilius commented on GitHub (Apr 6, 2018): To confirm that, I need to modify ssh config inside docker and build my own docker image I modified "docker/etc/ssh/sshd_config" file, and ran `make` in `docker/` directory. But it gives me this error: ``` docker build --disable-content-trust=false -t gitea/gitea:latest . unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/ubuntu/go/src/code.gitea.io/gitea/docker/Dockerfile: no such file or directory Makefile:10: recipe for target 'docker' failed make: *** [docker] Error 1 ``` Do you have any documentation on how to build my own custom docker image?
Author
Owner

@ilius commented on GitHub (Apr 6, 2018):

It works fine with 10 concurrent clones which confirms that theory, because the doc says MaxStartups=10 by default

But we will need to build our own docker image anyway (as we need to customize the code to match our AWS-based infrastructure). I'd appreciate if you help me with build the docker image.

Thank you

@ilius commented on GitHub (Apr 6, 2018): It works fine with 10 concurrent clones which confirms that theory, because the doc says MaxStartups=10 by default But we will need to build our own docker image anyway (as we need to customize the code to match our AWS-based infrastructure). I'd appreciate if you help me with build the docker image. Thank you
Author
Owner

@nubenum commented on GitHub (Apr 6, 2018):

You need to run sudo make docker in the root of the gitea directory, not in the docker subdirectory (see the Makefiles). I was able to build the image like that just now.

@nubenum commented on GitHub (Apr 6, 2018): You need to run `sudo make docker` in the root of the gitea directory, not in the docker subdirectory (see the Makefiles). I was able to build the image like that just now.
Author
Owner

@ilius commented on GitHub (Apr 9, 2018):

@nubenum Thank you very much

@ilius commented on GitHub (Apr 9, 2018): @nubenum Thank you very much
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1681