Gogs is an open-source Git server for hosting source code inside a private network. In a containerized build system, it provides source control alongside a Docker registry and Jenkins. section 11.2
A practical Gogs setup follows these steps:
- Start the infrastructure with Docker Compose, choosing the Linux- or Windows-container override. section 11.2
- Open the web interface at localhost:3000 and register a user manually. section 11.2
- Create a Git repository, add it as a local remote, and push source code using the registered credentials. section 11.2
# add registry domain to local hosts file on Mac or Linux: sudo ./scripts/add-to-hosts.sh registry.local 127.0.0.1 # OR using PowerShell (run as admin) ./scripts/add-to-hosts.ps1 registry.local 127.0.0.1 # switch to infrastructure folder: cd ch11/exercises/infrastructure # start the app with Linux containers: docker compose -f docker-compose.yml -f docker-compose-linux.yml up -d # OR start with Windows Server containers: docker compose -f docker-compose.yml -f docker-compose-windows.yml up -d # check containers: docker container ls
Use the startup commands to add the local registry hostname, enter the infrastructure directory, launch the correct Compose configuration, and verify running containers. section 11.2
Private build infrastructure
A local setup publishes Gogs on port 3000, Jenkins on port 8080, and a Docker registry on port 5010. Gogs stores application source, Jenkins runs the pipeline, and the registry distributes images. Gogs automates system setup but still requires manual user creation. section 11.2
Hands-on pipeline lab
Build a CI pipeline for the to-do app by creating a Compose build override, creating a Jenkins job, and pushing the changes to the diamol repository in Gogs. Expect to inspect logs and adjust failed builds. section 11.6
