mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-08-18 10:57:19 +02:00
Install latest tool releases at build time
This commit is contained in:
@@ -9,19 +9,17 @@
|
||||
|
||||
ARG BUILD_FROM
|
||||
ARG BUILD_VERSION
|
||||
ARG BUILD_UPSTREAM="0.144.3"
|
||||
ARG HEADROOM_VERSION="0.31.0"
|
||||
ARG RTK_VERSION="v0.43.0"
|
||||
ARG RTK_COMMIT="5a7880d404db8364d602f2ecdc41dd790f64013f"
|
||||
|
||||
FROM rust:1.91-bookworm AS rtk-builder
|
||||
ARG RTK_VERSION
|
||||
ARG RTK_COMMIT
|
||||
RUN git clone --depth 1 --branch "${RTK_VERSION}" https://github.com/rtk-ai/rtk.git /src/rtk && \
|
||||
test "$(git -C /src/rtk rev-parse HEAD)" = "${RTK_COMMIT}" && \
|
||||
cd /src/rtk && \
|
||||
cargo build --release --locked && \
|
||||
install -D -m 0755 target/release/rtk /out/rtk && \
|
||||
FROM rust:bookworm AS rtk-builder
|
||||
RUN set -eux; \
|
||||
rtk_version="$(git ls-remote --tags --refs --sort=-v:refname \
|
||||
https://github.com/rtk-ai/rtk.git 'refs/tags/v*' \
|
||||
| awk -F/ '$3 ~ /^v[0-9]+\.[0-9]+\.[0-9]+$/ { print $3; exit }')"; \
|
||||
test -n "$rtk_version"; \
|
||||
git clone --depth 1 --branch "$rtk_version" https://github.com/rtk-ai/rtk.git /src/rtk; \
|
||||
cd /src/rtk; \
|
||||
cargo build --release --locked; \
|
||||
install -D -m 0755 target/release/rtk /out/rtk; \
|
||||
/out/rtk --version
|
||||
|
||||
FROM ${BUILD_FROM}
|
||||
@@ -39,9 +37,6 @@ USER root
|
||||
VOLUME [ "/sys/fs/cgroup" ]
|
||||
|
||||
ARG TEMPLATE_BASE_URL="https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates"
|
||||
ARG TTYD_VERSION="1.7.7"
|
||||
ARG BUILD_UPSTREAM
|
||||
ARG HEADROOM_VERSION
|
||||
|
||||
##################
|
||||
# 3 Install apps #
|
||||
@@ -68,7 +63,7 @@ RUN apt-get update && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install the pinned official Codex static binary for the target architecture.
|
||||
# Install the latest stable official Codex static binary for the target architecture.
|
||||
RUN set -eux; \
|
||||
case "$(dpkg --print-architecture)" in \
|
||||
amd64) codex_arch="x86_64" ;; \
|
||||
@@ -78,13 +73,13 @@ RUN set -eux; \
|
||||
archive="/tmp/codex.tar.gz"; \
|
||||
curl -fsSL --retry 3 --retry-delay 2 \
|
||||
-o "$archive" \
|
||||
"https://github.com/openai/codex/releases/download/rust-v${BUILD_UPSTREAM}/codex-${codex_arch}-unknown-linux-musl.tar.gz"; \
|
||||
"https://github.com/openai/codex/releases/latest/download/codex-${codex_arch}-unknown-linux-musl.tar.gz"; \
|
||||
tar -xzf "$archive" -C /tmp; \
|
||||
install -m 0755 "/tmp/codex-${codex_arch}-unknown-linux-musl" /usr/local/bin/codex; \
|
||||
rm -f "$archive" "/tmp/codex-${codex_arch}-unknown-linux-musl"; \
|
||||
codex --version
|
||||
|
||||
# ttyd provides the Home Assistant ingress terminal.
|
||||
# Install the latest stable ttyd binary for the Home Assistant ingress terminal.
|
||||
RUN set -eux; \
|
||||
case "$(dpkg --print-architecture)" in \
|
||||
amd64) ttyd_arch="x86_64" ;; \
|
||||
@@ -93,13 +88,13 @@ RUN set -eux; \
|
||||
esac; \
|
||||
curl -fsSL --retry 3 --retry-delay 2 \
|
||||
-o /usr/local/bin/ttyd \
|
||||
"https://github.com/tsl0922/ttyd/releases/download/${TTYD_VERSION}/ttyd.${ttyd_arch}"; \
|
||||
"https://github.com/tsl0922/ttyd/releases/latest/download/ttyd.${ttyd_arch}"; \
|
||||
chmod 0755 /usr/local/bin/ttyd; \
|
||||
ttyd --version
|
||||
|
||||
COPY --from=rtk-builder /out/rtk /usr/local/bin/rtk
|
||||
RUN rtk --version && \
|
||||
pip3 install --break-system-packages --no-cache-dir "headroom-ai[proxy,code,mcp]==${HEADROOM_VERSION}" && \
|
||||
pip3 install --upgrade --break-system-packages --no-cache-dir "headroom-ai[proxy,code,mcp]" && \
|
||||
headroom --version
|
||||
|
||||
ARG MODULES="00-banner.sh 00-global_var.sh 01-custom_script.sh 00-local_mounts.sh 00-smb_mounts.sh 90-dns_set.sh"
|
||||
|
||||
Reference in New Issue
Block a user