A complete, ready-to-use GitLab instance with an automatically registered GitLab Runner for local development and CI/CD testing.
Note: This repository is used as part of the CCIE Automation Bootcamp at DevNet Academy.
- One-Command Setup - Get a fully functional GitLab instance running with a single command
- Automatic Runner Registration - GitLab Runner is automatically registered and ready to use
- Docker-Based - All services run in containers for easy management and isolation
- Persistent Data - All GitLab data, repositories, and configurations persist across restarts
- Network Testing Ready - Optimized for testing network devices in Cisco CML environments
- CI/CD Ready - Sample pipeline included to get started with GitLab CI/CD
Simply run:
docker compose up -dThat's it! The setup will automatically:
- Start GitLab CE
- Register the GitLab Runner
- Configure everything to work together
Note:
- GitLab takes 5-10 minutes to fully initialize on the first startup
- The runner will automatically register once GitLab is ready
- You can monitor progress with:
docker compose logs -f
Once GitLab is ready (check with docker compose ps), access it at:
- URL: http://localhost:8081
- Username:
root - Password:
1234QWer!
-
GitLab CE (
web)- Full GitLab instance with all features
- Accessible at http://localhost:8081
- HTTPS available at https://localhost:8443
-
GitLab Runner (
runner)- Automatically registered on startup
- Executes CI/CD pipelines
- Uses Docker executor
-
Register Runner (
register-runner)- One-time service that registers the runner
- Runs automatically and exits after registration
docker compose psAll services should show as "Up" and GitLab should be "healthy".
# All services
docker compose logs -f
# Specific service
docker compose logs -f web
docker compose logs -f runnerdocker compose downdocker compose down -vThis will delete all GitLab data, repositories, and configurations. Use with caution!
docker compose restartThe runner is configured to:
- Run untagged jobs automatically
- Access GitLab via the internal Docker network
- Connect to network devices in the same CML subnet
test:
script:
- echo "Hello from GitLab CI!"
- python --version- Normal during first startup: Wait 5-10 minutes for GitLab to initialize
- Check logs:
docker compose logs web - Verify health:
docker compose psshould show "healthy" after initialization
- Check registration logs:
docker compose logs register-runner - Ensure GitLab is healthy before registration
- Verify config exists:
ls -la config/config.toml - Re-register manually if needed:
docker compose up -d register-runner
- The runner is configured with
clone_url = "http://web"to work inside containers - If you see connection errors, verify the runner config:
cat config/config.toml - Restart the runner:
docker compose restart runner
If ports 8081 or 8443 are already in use:
- Edit
docker-compose.yml - Change the port mappings (e.g.,
'8082:80'instead of'8081:80') - Update
external_urlin theGITLAB_OMNIBUS_CONFIGsection - Restart:
docker compose down && docker compose up -d
If you've modified docker-compose.yml:
docker compose exec web gitlab-ctl reconfigure
docker compose restart webFor a completely fresh start:
docker compose down -v
docker compose up -dAll data is stored in local directories:
gitlab/- GitLab configuration, logs, and data (repositories, users, etc.)config/- GitLab Runner configurationdata/- Runner cache data
Important: These directories are created automatically and contain all your GitLab data. To start completely fresh, delete these directories and run docker compose up -d again.
- Network: All services run on the
gitlab-networkDocker network - Runner: Uses Docker executor for CI/CD job execution
- Clone URL: Configured to use
http://web(internal service name) for Git operations - Storage: All data persists in local directories
- Default credentials are set for educational purposes
- For production use, change the root password immediately
- The runner runs with standard Docker access (not privileged)
- All services are on an isolated Docker network
- Docker Engine 20.10+
- Docker Compose 2.0+
- At least 4GB RAM (8GB recommended)
- At least 10GB free disk space
For issues or questions:
- Check the troubleshooting section above
- Review service logs:
docker compose logs - Verify all services are running:
docker compose ps
Contributions are welcome! If you'd like to contribute to this project:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure that:
- Your code follows existing patterns and conventions
- You've tested your changes locally
- You've updated the README if needed
- You haven't committed any sensitive data (secrets, tokens, etc.)
This project is provided as-is for educational and development purposes. GitLab CE is licensed under the MIT Expat License.
Important Security Note: This setup includes default credentials for local development. Never use these default credentials in production environments. Always change the root password and registration tokens before deploying to any accessible network.