{"id":26104441,"url":"https://github.com/nadeesamaraweera/docker-manage","last_synced_at":"2026-05-06T14:34:01.044Z","repository":{"id":281466385,"uuid":"943637617","full_name":"nadeesamaraweera/Docker-Manage","owner":"nadeesamaraweera","description":"Docker is a platform for managing containers, enabling applications to run in isolated environments efficiently.","archived":false,"fork":false,"pushed_at":"2025-03-09T08:57:44.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T09:27:19.486Z","etag":null,"topics":["docker","docker-image","jar","logger"],"latest_commit_sha":null,"homepage":"","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/nadeesamaraweera.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":"2025-03-06T03:05:40.000Z","updated_at":"2025-03-09T08:57:48.000Z","dependencies_parsed_at":"2025-03-09T09:37:56.434Z","dependency_job_id":null,"html_url":"https://github.com/nadeesamaraweera/Docker-Manage","commit_stats":null,"previous_names":["nadeesamaraweera/docker-manage"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadeesamaraweera%2FDocker-Manage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadeesamaraweera%2FDocker-Manage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadeesamaraweera%2FDocker-Manage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadeesamaraweera%2FDocker-Manage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nadeesamaraweera","download_url":"https://codeload.github.com/nadeesamaraweera/Docker-Manage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242750786,"owners_count":20179257,"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-image","jar","logger"],"created_at":"2025-03-09T21:01:32.158Z","updated_at":"2026-05-06T14:33:59.303Z","avatar_url":"https://github.com/nadeesamaraweera.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Setup and Management Guide\n\n## Introduction\nDocker is a platform for managing containers, enabling applications to run in isolated environments efficiently. This guide covers the fundamental Docker commands to build, run, and manage containers for Java and Spring Boot applications.\n\n## Prerequisites\n- Install Docker on your system.\n- Verify the installation using the following command:\n  ```sh\n  docker --version\n  ```\n\n## Building and Running a Java Application with Docker\n\n### 1. Prepare the Java Application\nNavigate to your project directory and clean/package the application using Maven:\n```sh\nmvn clean\nmvn package\n```\nThe JAR file will be created inside the `target` folder.\n\n### 2. Create a Dockerfile\nCreate a `Dockerfile` in the project root and specify the instructions for building the image. Example:\n```dockerfile\nFROM openjdk:17\nCOPY target/your-app.jar app.jar\nENTRYPOINT [\"java\", \"-jar\", \"app.jar\"]\n```\n\n### 3. Build the Docker Image\nRun the following command to build the Docker image:\n```sh\ndocker build -t your-image-name .\n```\n\n### 4. Verify the Docker Image\nTo check the available Docker images, use:\n```sh\ndocker images\n```\n\n### 5. Run the Docker Container\nTo run the application in a container, use:\n```sh\ndocker run -p 8090:8085 your-image-name\n```\nRun the container in detached mode (background execution):\n```sh\ndocker run -d -p 8090:8085 your-image-name\n```\n\n## Managing Running Containers\n\n### Check Running Containers\n```sh\ndocker ps\n```\nCheck all containers (including stopped ones):\n```sh\ndocker ps -a\n```\n\n### View Logs\nTo view application logs in real time:\n```sh\ndocker logs -f \u003ccontainer-id\u003e\n```\n\n### Stop and Remove Containers\nStop a running container:\n```sh\ndocker stop \u003ccontainer-id\u003e\n```\nRemove a container:\n```sh\ndocker rm \u003ccontainer-id\u003e\n```\n\n### Remove Docker Images\nTo remove an image:\n```sh\ndocker rmi your-image-name\n```\nForce remove an image:\n```sh\ndocker rmi -f your-image-name\n```\n\n## Docker Hub (Optional)\nDocker Hub is used to share Docker images but does not provide version control. To pull a Java 17 image from Docker Hub, use:\n```sh\ndocker pull openjdk:17\n```\n\n## Conclusion\nThis guide covers the essential Docker commands to build and manage your Java/Spring Boot applications efficiently. Using Docker, you can ensure consistent deployment environments and simplify application management.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnadeesamaraweera%2Fdocker-manage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnadeesamaraweera%2Fdocker-manage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnadeesamaraweera%2Fdocker-manage/lists"}