{"id":17072208,"url":"https://github.com/darrenhaken/docker-examples","last_synced_at":"2026-04-19T14:01:25.423Z","repository":{"id":153082897,"uuid":"89263808","full_name":"darrenhaken/docker-examples","owner":"darrenhaken","description":"Docker examples demonstrating it's capabilities with Java applications","archived":false,"fork":false,"pushed_at":"2017-05-31T14:17:37.000Z","size":25306,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T07:16:38.885Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darrenhaken.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-24T16:37:53.000Z","updated_at":"2017-04-27T09:23:27.000Z","dependencies_parsed_at":"2023-07-14T02:30:59.306Z","dependency_job_id":null,"html_url":"https://github.com/darrenhaken/docker-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/darrenhaken/docker-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrenhaken%2Fdocker-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrenhaken%2Fdocker-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrenhaken%2Fdocker-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrenhaken%2Fdocker-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darrenhaken","download_url":"https://codeload.github.com/darrenhaken/docker-examples/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrenhaken%2Fdocker-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32009239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-14T11:39:04.467Z","updated_at":"2026-04-19T14:01:25.375Z","avatar_url":"https://github.com/darrenhaken.png","language":"Java","readme":"# docker-examples\nDocker examples demonstrating it's capabilities running multiple applications at the same time\n\n## Docker guide\n\n#### 1. Local run\n\nRun Spring Boot locally (via IDE)\n\n#### Show version 1.0 running in Docker\n``` bash\ndocker-compose up\ndocker ps\n```\n\n[Browse to Java app](http://localhost:8080 \"Java App\")\n\n[Browse to Python app](http://localhost:5000 \"Python App\")\n\n#### Docker image versioning\nIncrease the tag to 1.1 in Docker compose\n``` bash\ndocker-compose build\ndocker-compose up\n```\n[Browse to localhost:8080](http://localhost:8080 \"Spring Boot Homepage\")\n\n[Browse to localhost:5000](http://localhost:5000 \"Flask Homepage\")\n\n### Orchestration\n\n#### Deploy to Swarm\nSetup Docker Swarm on master\n``` bash\n#Get IP of manager\ndocker-machine ip manager1\n\n# SSH on manager\ndocker-machine ssh manager1\n\n#Initialise swarm with node as leader\n#Will skip this step as I did it ahead of time\ndocker swarm init --advertise-addr \u003cMANAGER-IP\u003e\n\n#Show nodes connected to swarm\ndocker node ls\n```\n\nJoin Swarm on the workers\n\n``` bash\n\ndocker-machine ssh worker1\n\ndocker swarm join \\\n    --token SWMTKN-1-5ivfibz1i7mok4mh919aleuh9ksbskok8boj3v4tt4ifzd7g72-bxrfrwg5w842f2jj6d6pyzffu \\\n    192.168.99.100:2377\n```\n\nDeploy stack to swarm\n\n#### Change Docker Daemon \neval $(docker-machine env manager1)\n\n#### Build cluster on Docker on manager1\ndocker-compose build\n\n#### Set the docker cli to use manager1\ndocker-machine env manager1\n\n#### Optional but might be needed\ndocker-machine regenerate-certs manager1\n\n#### Deploy cluster to manager1\ndocker stack deploy --compose-file docker-compose.yml helloworld \n\n#### On the Docker manager\ndocker service ls\n\n#### Lets scale Web up\ndocker service scale helloworld_web=8\n\n#### Applying rolling updates\ndocker service update --image \u003cimagename\u003e:\u003cversion\u003e web\n\n#### Let's kill the containers\ndocker service rm helloworld_redis\ndocker stop $(docker ps -a -q)\n\n#### Removing services\ndocker service rm helloworld_flask helloworld_web helloworld_redis\n\n#### Revert docker daemon back to Docker for Mac\neval $(docker-machine env -u)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarrenhaken%2Fdocker-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarrenhaken%2Fdocker-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarrenhaken%2Fdocker-examples/lists"}