{"id":15172731,"url":"https://github.com/fritzthecat9/dockertest","last_synced_at":"2026-02-11T04:32:03.211Z","repository":{"id":234499248,"uuid":"789024790","full_name":"FritzTheCat9/DockerTest","owner":"FritzTheCat9","description":"Deploy C# web API to Raspberry Pi with Docker","archived":false,"fork":false,"pushed_at":"2024-04-24T19:39:24.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T04:39:07.888Z","etag":null,"topics":["api","c-sharp","csharp","docker","http","https","minimal-api","raspberry-pi","raspberry-pi-4"],"latest_commit_sha":null,"homepage":"","language":"C#","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/FritzTheCat9.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":"2024-04-19T14:58:08.000Z","updated_at":"2025-03-05T23:44:51.000Z","dependencies_parsed_at":"2024-04-19T16:09:08.072Z","dependency_job_id":"2360a226-fe72-4c39-a309-76242a9219df","html_url":"https://github.com/FritzTheCat9/DockerTest","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"b9ebb533cf7530ddc6d198284931aaeffcf3d071"},"previous_names":["fritzthecat9/dockertest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FritzTheCat9/DockerTest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FritzTheCat9%2FDockerTest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FritzTheCat9%2FDockerTest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FritzTheCat9%2FDockerTest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FritzTheCat9%2FDockerTest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FritzTheCat9","download_url":"https://codeload.github.com/FritzTheCat9/DockerTest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FritzTheCat9%2FDockerTest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270586485,"owners_count":24611317,"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","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"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":["api","c-sharp","csharp","docker","http","https","minimal-api","raspberry-pi","raspberry-pi-4"],"created_at":"2024-09-27T10:04:08.760Z","updated_at":"2026-02-11T04:32:03.204Z","avatar_url":"https://github.com/FritzTheCat9.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Deploy C# web API to raspberry pi with docker\nThis repository contains C# web API code that provides one endpoint at the addresses (http://localhost:5000/weatherforecast, https://localhost:5001/weatherforecast). \n\nThe README.md file contains commands that will allow you to:\n- create an image of your API\n- add the image to the docker hub platform\n- download the image to the Raspberry Pi\n- run the container with your web API on the Raspberry Pi\n\n### Build, Build for raspberry pi (for raspberry pi target platform \"linux/arm64\"):\n```\ndocker build -t dockertest_api .\ndocker build -t dockertest_api --platform linux/arm64/v8 .\ndocker build --no-cache -t dockertest_api --platform=linux/arm/v7 .\ndocker build --no-cache -t dockertest_api --platform=linux/arm64/v8 .\ndocker build --no-cache -t dockertest_api --platform=linux/arm64 .\n-t - name and tag of the image\n```\n### Rebuild (--no-cache):\n```\ndocker build --no-cache -t dockertest_api .\n```\n### Working http:\n```\ndocker run -d -p 5000:5000 -e ASPNETCORE_HTTP_PORTS=5000 -e ASPNETCORE_ENVIRONMENT=Development dockertest_api\n```\n### Working certs (generate certificates then copy to raspberry pi):\n```\ndotnet dev-certs https --clean\ndotnet dev-certs https -ep $HOME\\.aspnet\\https\\aspnetapp.pfx -p password\ndotnet dev-certs https --trust\n-ep - path to existing certificate file (.pfx) that you want to use for HTTPS development (existing PFX file)\n```\n##### IMPORTANT - COPY CERTIFICATE TO RASPBERRY PI!!! (use scp) -\u003e to: $HOME/.aspnet/https (change \u003craspberrypi_ip\u003e to correct Raspberry Pi ip)\n```\nscp C:\\Users\\bartl\\.aspnet\\https\\aspnetapp.pfx malinka@\u003craspberrypi_ip\u003e:/home/malinka/https/\n```\n### Working https:\n```\ndocker run -d -p 5000:5000 -p 5001:5001 -e ASPNETCORE_URLS=\"https://+:5001;http://+:5000\" -e ASPNETCORE_HTTP_PORTS=5000 -e ASPNETCORE_HTTPS_PORT=5001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Default__Password=password -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v \"$HOME/.aspnet/https:/https/\" dockertest_api\n```\n### Other WRONG commands:\n```\ndotnet dev-certs https -ep %USERPROFILE%\\.aspnet\\https\\aspnetapp.pfx -p password\ndocker run -d -p 5000:5000 -p 5001:5001 -e ASPNETCORE_URLS=\"https://+;http://+\" -e ASPNETCORE_HTTP_PORTS=5000 -e ASPNETCORE_HTTPS_PORT=5001 -e ASPNETCORE_Kestrel__Certificates__Default__Password=password -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v %USERPROFILE%\\.aspnet\\https:/https/ dockertest_api\ndocker run -d -p 5000:5000 -p 5001:5001 -e ASPNETCORE_URLS=\"https://+;http://+\" -e ASPNETCORE_HTTP_PORTS=5000 -e ASPNETCORE_HTTPS_PORT=5001 -e ASPNETCORE_Kestrel__Certificates__Default__Password=password -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v \"$HOME/.aspnet/https:/https/\" dockertest_api\n```\n### Tag your local image\n```\ndocker tag dockertest_api fritzthecat9/dockertest_api:1.0\ndocker tag dockertest_api fritzthecat9/dockertest_api:latest\n```\n### Log in to Docker Hub\n```\ndocker login\n```\n### Push your image to Docker Hub\n```\ndocker push fritzthecat9/dockertest_api:latest\n```\n### Pull image on raspberry pi:\n```\ndocker pull fritzthecat9/dockertest_api:latest\ndocker images\n```\n### Run on raspberry pi:\n```\ndocker pull fritzthecat9/dockertest_api:latest\ndocker run -d -p 5000:5000 -p 5001:5001 -e ASPNETCORE_URLS=\"https://+:5001;http://+:5000\" -e ASPNETCORE_HTTP_PORTS=5000 -e ASPNETCORE_HTTPS_PORT=5001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Default__Password=password -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v \"$HOME/.aspnet/https:/https/\" fritzthecat9/dockertest_api:latest\n```\n### Remove container\n```\ndocker rm container_name_or_id\n```\n### Remove image\n```\ndocker rmi image_name_or_id\n```\n### Container logs\n```\ndocker logs container_name_or_id\n-f - continuously follow or stream the logs generated by a Docker container\ndocker logs -f container_name_or_id\n```\n### Fetch docker api\n```\ncurl http://localhost:5000/weatherforecast\ncurl https://localhost:5001/weatherforecast\n-k - ignore certificate check\ncurl -k https://localhost:5001/weatherforecast\n```\n### Start and stop docker container\n```\ndocker stop container_id\ndocker start container_id\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffritzthecat9%2Fdockertest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffritzthecat9%2Fdockertest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffritzthecat9%2Fdockertest/lists"}