{"id":21008603,"url":"https://github.com/sonnyrr/nuke-docker-github-registry","last_synced_at":"2025-05-15T02:32:26.822Z","repository":{"id":39106068,"uuid":"366990263","full_name":"SonnyRR/nuke-docker-github-registry","owner":"SonnyRR","description":"🗜 An example project using NUKE + Docker + GitHub Image Registry that shows how to publish Docker images via GitHub actions.","archived":false,"fork":false,"pushed_at":"2024-11-17T09:34:23.000Z","size":95,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-17T10:28:28.437Z","etag":null,"topics":["built-in-containers","cicd","csharp","docker","docker-image","dotnet","github-actions","github-registry","linux-containers","nuke","nuke-build","webapi-core"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SonnyRR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-05-13T08:54:31.000Z","updated_at":"2024-11-17T09:33:18.000Z","dependencies_parsed_at":"2023-02-15T11:01:34.033Z","dependency_job_id":"b9ee492e-3a8e-4798-8ec5-cd1256742958","html_url":"https://github.com/SonnyRR/nuke-docker-github-registry","commit_stats":null,"previous_names":[],"tags_count":72,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonnyRR%2Fnuke-docker-github-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonnyRR%2Fnuke-docker-github-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonnyRR%2Fnuke-docker-github-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonnyRR%2Fnuke-docker-github-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SonnyRR","download_url":"https://codeload.github.com/SonnyRR/nuke-docker-github-registry/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225324124,"owners_count":17456460,"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":["built-in-containers","cicd","csharp","docker","docker-image","dotnet","github-actions","github-registry","linux-containers","nuke","nuke-build","webapi-core"],"created_at":"2024-11-19T09:12:59.554Z","updated_at":"2025-05-15T02:32:26.784Z","avatar_url":"https://github.com/SonnyRR.png","language":"C#","readme":"# NUKE + Docker Image + GitHub Container Registry = ♥\n![ci workflow status](https://github.com/SonnyRR/nuke-docker-github-registry/actions/workflows/ci.yml/badge.svg)\n\nThis is a simple project utilizing the NUKE automated build system and Docker that serves as an example of how to push Docker Images to the GitHub Container registry.\n\nCheck out NUKE:\nhttps://github.com/nuke-build/nuke\n\n\n## 💭 About\nℹ The sample API used in this repo is a `.NET 9 WebAPI` project utilizing the newly introduced `built-in container support`. \nI've also included a `dockerfile` which is also utilized in the `CI` pipeline. It's a magic 8-ball, that when prompted with a yes/no question will give you a random answer.\n\n## 🏗 NUKE Build Project\nThe automated build project contains the necessary targets to `clean`, `restore`, `compile`, `build` and `publish` the docker images. \nYou can view the target definitions in the `Build.cs` file and use it as a reference for your projects. \nIt also contains a setup for `GitVersion` which lets us use semantic versioning when we tag the `git` commits \u0026 `docker` images.\n\n## 📦 CI Pipeline\nThe artifacts produced by the `GitHub Actions` CI pipeline are two images with different tags. \nOne of the images is built with the traditional multi-stage `Dockerfile`, while the other one utilizes the newly introduced `built-in` container support\n\nYou can view the whole pipeline config here: `.github/workflows/ci.yml` and use it as a reference for your projects.\n\n## 🛠 Local Setup\n\n### 🚢 Built-in container support\nTo build the docker image with the built-in container support, execute the following NUKE target:\n\n```sh\n# Global tool\nnuke BuildApiImageWithBuiltInContainerSupport\n\n# Shell script:\n./build.sh BuildApiImageWithBuiltInContainerSupport\n```\n\nThe aforementioned target will create a new image with the `built-in` tag: `magic-8-ball-api:built-in`.\n\n❗ Only `Linux-x64` containers are supported with this approach.\n\n### 🐳 Dockerfile\nTo build the docker image with the dockerfile, execute the following NUKE target:\n\n```sh\n# Global tool\nnuke BuildApiImageWithDockerfile\n\n# Shell script:\n./build.sh BuildApiImageWithDockerfile\n```\n\nThe aforementioned target will create a new image with the `dockerfile` tag: `magic-8-ball-api:dockerfile`.\n\n\n## 🏃‍♀️ Run the containers\n```sh\n# Image built with built-in container support\ndocker run -d -p 5000:8080 --name m8b magic-8-ball-api:built-in\n\n# Image built with dockerfile\ndocker run -d -p 5000:8080 --name m8b magic-8-ball-api:dockerfile\n```\n\nAfter that you can navigate to `http://localhost:5000` and it will redirect you to the `swagger` documentation for the `API`.\n\n❗ I've intentionally not setup `HTTPS` redirection \u0026 not exposed the `443` port since that would require mounting additional volumes to access the development certifiacte. However feel free to update the `docker run` statement or a `docker-compose` file to mount those volumes \u0026 assign the necessary environment variables. You would also need to update the `Dockerfile` \u0026 API `.csproj` file to expose the ports.\n\nTo stop the container run the following command:\n```sh\ndocker stop m8b\n\n# To delete the container\ndocker rm m8b\n\n# To delete the image\ndocker rmi magic-8-ball-api:dockerfile\ndocker rmi magic-8-ball-api:built-in \n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonnyrr%2Fnuke-docker-github-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonnyrr%2Fnuke-docker-github-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonnyrr%2Fnuke-docker-github-registry/lists"}