Sign inSign up

cpetrow/netdaemon-app

By cpetrow

•Updated about 2 years ago

A build which publishes a NetDaemon app for ready to use .yaml (Home Assistant).

Image
Integration & delivery
API management
0

106

cpetrow/netdaemon-app repository overview

⁠Repository Overview:

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.

⁠Dockerfile:

⁠Use the .NET 8.0 SDK image to build the application

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /app

⁠Copy csproj and restore as distinct layers

COPY *.csproj ./ RUN dotnet restore

⁠Copy everything else and build

COPY . ./ RUN dotnet publish -c Release -o out NetDaemonHASS.csproj

⁠Steps

⁠Base Image Selection:

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.

⁠Set Working Directory:

The working directory inside the Docker container is set to /app, where all subsequent commands will be executed.

⁠Copy Project Files and Restore Dependencies:

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.

⁠Copy All Files and Build the Application:

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.

Tag summary

Content type

Image

Digest

sha256:40621bd99…

Size

358.5 MB

Last updated

about 2 years ago

docker pull cpetrow/netdaemon-app:0.0.1