Skip to content

Commit 4335560

Browse files
committed
Docker and build, sync with EMHASS, revert build_from to original design
1 parent 8e1f2bb commit 4335560

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

emhass/Dockerfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22

33
#build_version options are: addon (default), addon-git
44
ARG build_version=addon
5-
#BUILD_ARCH, HA equivalent to TARGETARCH
6-
ARG BUILD_ARCH
7-
#BUILD_FROM, os_version equivalent
5+
#see build.yaml for all docker images according to host architecture
86
ARG BUILD_FROM
97

10-
11-
FROM ghcr.io/home-assistant/$BUILD_ARCH-base-$BUILD_FROM:bookworm AS base
12-
8+
FROM ${BUILD_FROM} AS base
139

1410
#check if BUILD_ARCH passed by build-arg
1511
ARG BUILD_ARCH
@@ -44,15 +40,20 @@ RUN apt-get update \
4440
libglpk-dev \
4541
glpk-utils \
4642
libatlas-base-dev \
47-
libopenblas-dev
43+
libopenblas-dev
4844
#specify hdf5
4945
RUN ln -s /usr/include/hdf5/serial /usr/include/hdf5/include && export HDF5_DIR=/usr/include/hdf5
50-
#try symlink apt cbc to pulp python directory
51-
RUN ln -sf /usr/bin/cbc /usr/local/lib/python3.11/dist-packages/pulp/solverdir/cbc/linux/32/cbc || echo "cbc link didnt work"
5246

5347
#install packages from pip, use piwheels if arm
5448
RUN [[ "${BUILD_ARCH}" == "armhf" || "${BUILD_ARCH}" == "armv7" ]] && pip3 install --index-url=https://www.piwheels.org/simple --no-cache-dir --break-system-packages -r requirements.txt || pip3 install --no-cache-dir --break-system-packages -r requirements.txt
5549

50+
#try symlink apt cbc to pulp cbc in python directory (for 32bit)
51+
RUN [[ "${BUILD_ARCH}" == "armhf" ]] && ln -sf /usr/bin/cbc /usr/local/lib/python3.11/dist-packages/pulp/solverdir/cbc/linux/32/cbc || echo "cbc symlink didnt work/not required"
52+
53+
#if armv7 try install libatomic1 to fix scipy issue
54+
RUN [[ "${BUILD_ARCH}" == "armv7" ]] && apt-get update && apt-get install libatomic1 || echo "libatomic1 cant be installed"
55+
56+
5657
#remove build only packages
5758
RUN apt-get purge -y --auto-remove \
5859
git \

emhass/build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
build_from: #choose between debian or raspbian images
2-
armhf: raspbian
3-
aarch64: debian
4-
amd64: debian
5-
armv7: debian
2+
amd64: ghcr.io/home-assistant/amd64-base-debian:bookworm
3+
armhf: ghcr.io/home-assistant/armhf-base-raspbian:bookworm
4+
armv7: ghcr.io/home-assistant/armv7-base-debian:bookworm
5+
aarch64: ghcr.io/home-assistant/aarch64-base-debian:bookworm
66
args:
77
build_version: addon
88
build_repo: https://github.com/davidusb-geek/emhass.git #addon-git mode

0 commit comments

Comments
 (0)