Pin ha-n95-local-control tag v0.1.2 (7bed99cc4c3222bad648efcddcdfed95652277f7). Health bind failure no longer takes down 8007/8005/5223 when OTBR owns 8080.
56 lines
2.0 KiB
Docker
56 lines
2.0 KiB
Docker
# syntax=docker/dockerfile:1
|
|
ARG GO_VERSION=1.27.1
|
|
ARG BUILD_FROM=ghcr.io/home-assistant/base:3.22
|
|
FROM golang:${GO_VERSION}-alpine AS build
|
|
|
|
RUN apk add --no-cache ca-certificates git
|
|
WORKDIR /src
|
|
|
|
ARG UPSTREAM_REPOSITORY=https://git.i3omb.com/gronod/ha-n95-local-control.git
|
|
ARG UPSTREAM_REF=v0.1.2
|
|
ARG UPSTREAM_COMMIT=7bed99cc4c3222bad648efcddcdfed95652277f7
|
|
RUN git init . \
|
|
&& git remote add origin "${UPSTREAM_REPOSITORY}" \
|
|
&& git fetch --depth 1 origin "refs/tags/${UPSTREAM_REF}:refs/tags/${UPSTREAM_REF}" \
|
|
&& test "$(git rev-list -n 1 "${UPSTREAM_REF}^{commit}")" = "${UPSTREAM_COMMIT}" \
|
|
&& git checkout --detach "${UPSTREAM_REF}^{commit}"
|
|
|
|
RUN go mod download
|
|
ARG TARGETOS=linux
|
|
ARG TARGETARCH
|
|
ARG TARGETVARIANT
|
|
RUN case "${TARGETARCH}/${TARGETVARIANT}" in \
|
|
amd64/) goarch=amd64; goarm= ;; \
|
|
arm64/) goarch=arm64; goarm= ;; \
|
|
386/) goarch=386; goarm= ;; \
|
|
arm/v6) goarch=arm; goarm=6 ;; \
|
|
arm/v7) goarch=arm; goarm=7 ;; \
|
|
*) echo "Unsupported target: ${TARGETARCH}/${TARGETVARIANT}" >&2; exit 1 ;; \
|
|
esac \
|
|
&& CGO_ENABLED=0 GOOS="${TARGETOS}" GOARCH="${goarch}" GOARM="${goarm}" \
|
|
go build -trimpath -ldflags="-s -w" -o /out/n95bridge ./cmd/n95bridge
|
|
|
|
FROM ${BUILD_FROM}
|
|
|
|
COPY --from=build /out/n95bridge /n95bridge
|
|
COPY rootfs /
|
|
RUN chmod a+x /run.sh
|
|
|
|
ARG BUILD_VERSION=0.1.2
|
|
ARG BUILD_ARCH
|
|
ARG UPSTREAM_REF=v0.1.2
|
|
ARG UPSTREAM_COMMIT=7bed99cc4c3222bad648efcddcdfed95652277f7
|
|
LABEL \
|
|
io.hass.name="Deebot N95 Local Control" \
|
|
io.hass.description="Local MQTT control for an already-provisioned Deebot N95" \
|
|
io.hass.type="addon" \
|
|
io.hass.version="${BUILD_VERSION}" \
|
|
io.hass.arch="${BUILD_ARCH}" \
|
|
org.opencontainers.image.title="deebot-n95-local-control" \
|
|
org.opencontainers.image.source="https://git.i3omb.com/gronod/ha-gronod-addons" \
|
|
org.opencontainers.image.version="${BUILD_VERSION}" \
|
|
org.opencontainers.image.revision="${UPSTREAM_COMMIT}" \
|
|
com.gronod.upstream.ref="${UPSTREAM_REF}"
|
|
|
|
CMD [ "/run.sh" ]
|