forked from net-daemon/netdaemon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.AddOn
27 lines (21 loc) · 981 Bytes
/
Dockerfile.AddOn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# No admin support yet, we need to build the websocket API
# Pre-build .NET NetDaemon core project
FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim-amd64 as netbuilder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on ${BUILDPLATFORM}"
RUN echo "building for ${TARGETPLATFORM}"
RUN export TARGETPLATFORM="${TARGETPLATFORM}"
# Copy the source to docker container
COPY . /usr
RUN dotnet publish /usr/src/Host/NetDaemon.Host.Default/NetDaemon.Host.Default.csproj -o "/daemon"
# Final stage, create the runtime container
FROM ghcr.io/net-daemon/netdaemon_addonbase:8
# # Install S6 and the Admin site
COPY --chmod=755 ./Docker/rootfs/etc/services.d/netdaemon_addon /etc/s6-overlay/s6-rc.d/netdaemon_addon
COPY --chmod=755 ./Docker/rootfs/etc/s6-overlay/s6-rc.d/usr/netdaemon_addon etc/s6-overlay/s6-rc.d/user/contents.d/netdaemon_addon
# COPY admin
# COPY --from=builder /admin /admin
COPY --from=netbuilder /daemon /daemon
LABEL \
io.hass.version="VERSION"