{"id":15497102,"url":"https://github.com/zaneh/jenkins-docker-full","last_synced_at":"2025-04-22T21:42:56.972Z","repository":{"id":48969266,"uuid":"516898051","full_name":"ZaneH/jenkins-docker-full","owner":"ZaneH","description":"A complete template for running Jenkins in Docker with connected \"agent\" containers. This template also pushes a build image to a local registry.","archived":false,"fork":false,"pushed_at":"2022-07-23T17:40:28.000Z","size":43,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T19:11:07.249Z","etag":null,"topics":["docker","docker-compose","docker-image","docker-registry","dockerfile","jenkins","jenkins-pipeline","pipeline","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZaneH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-22T22:05:14.000Z","updated_at":"2024-05-24T02:54:38.000Z","dependencies_parsed_at":"2022-09-07T16:14:01.245Z","dependency_job_id":null,"html_url":"https://github.com/ZaneH/jenkins-docker-full","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZaneH%2Fjenkins-docker-full","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZaneH%2Fjenkins-docker-full/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZaneH%2Fjenkins-docker-full/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZaneH%2Fjenkins-docker-full/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZaneH","download_url":"https://codeload.github.com/ZaneH/jenkins-docker-full/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250330284,"owners_count":21412956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","docker-image","docker-registry","dockerfile","jenkins","jenkins-pipeline","pipeline","python"],"created_at":"2024-10-02T08:30:38.268Z","updated_at":"2025-04-22T21:42:56.952Z","avatar_url":"https://github.com/ZaneH.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jenkins Demo Pipeline\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/lqFbmrL.png\" width=\"475px\" /\u003e\u003c/p\u003e\n\n## Purpose\n\n- Run Jenkins in Docker - `./jenkins-docker/controller` and `./docker-compose.ci.yml`\n    - Attach build nodes as seperate containers - `./jenkins-docker/agent`\n- Run Jenkinsfile pipeline on our app - `./src`\n    - pylint, pytest, etc. - `./Jenkinsfile`\n    - Build image of our app and push to custom registry - `./Dockerfile.app`\n- Run custom Docker Registry - `./docker-compose.registry.yml`\n\n## How to Run\n\nYou may need `DOCKER_BUILDKIT=0` to complete this pipeline.\n\n#### 1. Start the local Docker Registry:\n\n```bash\n# start local docker registry at localhost:5000\ndocker-compose -f ./docker-compose.registry.yml up\n```\n\nThen we need `jenkins-controller` and `jenkins-agent` images in our custom registry.\n\n#### 2. Prepare Controller Image\n\n```bash\n# build Jenkins controller image and push to local registry\npushd jenkins-docker/controller\ndocker build -t jenkins-controller .\ndocker tag jenkins-controller:latest localhost:5000/jenkins-controller:latest\ndocker push localhost:5000/jenkins-controller:latest\npopd\n```\n\n#### 3. Prepare Agent Image\n\n```bash\n# build Jenkins agent image and push to local registry\npushd jenkins-docker/agent\ndocker build -t jenkins-agent .\ndocker tag jenkins-agent:latest localhost:5000/jenkins-agent:latest\ndocker push localhost:5000/jenkins-agent:latest\npopd\n```\n\n#### 4. Start Jenkins\n\n```bash\n# pull local controller and agent images and run\ndocker-compose -f ./docker-compose.ci.yml up\n```\n\n## Setup a Pipeline\n\nWhen Jenkins is ready, visit http://localhost:8080/ to setup your first job. The default admin credentials are `admin:admin`. Create a \"Pipeline\" with any name. Configure your Jenkinsfile to pull from your SCM (or this repo) and provide credentials if necessary.\n\nThe `jenkins-agent` we built \u0026 ran before will already be connected to `jenkins-controller`\nas a build node by this point. Visit http://localhost:8080/manage/computer/ to manage\nconnected nodes.\n\nOnce your Pipeline is setup, press the \"Build Now\" action in the sidebar to kick off the\nfirst build process. It will begin executing steps from within `Jenkinsfile` which is\ncurrently configured to lint code, run unit tests, build an image from `Dockerfile.app`\nand then push that image to our local registry as `demo-app:$BUILD_NUMBER`.\n\nYou can confirm the entire pipeline completed by checking http://localhost:5000/v2/_catalog\nto confirm that `demo-app`, `jenkins-controller`, and `jenkins-agent` are available in the\nlocal registry.\n\n## How to Integrate\n\nIntegrating this demo with your project shouldn't be too hard as most everything is automated and (currently) up-to-date. Here are my recommendations:\n\n- Modify the `agent/Dockerfile` to fit your Jenkins pipeline. This is currently setup with the `ubuntu:18.04` base image, `python3.9` and `pip3.9`\n- Move the `Jenkinsfile` into a seperate repo with the `src/` folder containing your app's code\n  - Move `Dockerfile.app` and `.dockerignore` too\n- Use the remaining files as your CI repository","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaneh%2Fjenkins-docker-full","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaneh%2Fjenkins-docker-full","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaneh%2Fjenkins-docker-full/lists"}