A build which publishes a NetDaemon app for ready to use .yaml (Home Assistant).
106
This repository provides a ready-to-use Docker configuration for building and publishing a .NET application using the .NET 8.0 SDK. The Dockerfile included in this repository leverages a multi-stage build process to ensure efficient dependency management and application publishing. Below is a detailed explanation of the Dockerfile and instructions for building and running the Docker container.
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /app
COPY *.csproj ./ RUN dotnet restore
COPY . ./ RUN dotnet publish -c Release -o out NetDaemonHASS.csproj
The base image mcr.microsoft.com/dotnet/sdk:8.0 includes the .NET 8.0 SDK, providing all necessary tools to build and publish the .NET application.
The working directory inside the Docker container is set to /app, where all subsequent commands will be executed.
The project file(s) (*.csproj) are copied to the working directory. The dotnet restore command restores dependencies specified in the project file, leveraging Docker's caching mechanism for efficient builds.
All remaining files are copied from the current directory to the working directory in the container. The dotnet publish command builds and publishes the application in Release mode, outputting the files to the out directory.
Content type
Image
Digest
sha256:40621bd99…
Size
358.5 MB
Last updated
about 2 years ago
docker pull cpetrow/netdaemon-app:0.0.1