61 lines
1.8 KiB
Docker
61 lines
1.8 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
ARG BUILD_FROM
|
|
FROM $BUILD_FROM
|
|
|
|
ARG BUILD_DATE
|
|
ARG BUILD_REF
|
|
ARG BUILD_VERSION
|
|
ARG BUILD_ARCH
|
|
|
|
LABEL \
|
|
io.hass.name="Folding@home" \
|
|
io.hass.description="Run Folding@home to contribute to scientific research" \
|
|
io.hass.arch="${BUILD_ARCH}" \
|
|
io.hass.type="addon" \
|
|
io.hass.version=${BUILD_VERSION} \
|
|
maintainer="retr0"
|
|
|
|
# Add needed NVIDIA environment variables for container toolkit
|
|
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
|
|
|
|
# Prevent interactive prompts during package installation
|
|
ENV DEBIAN_FRONTEND="noninteractive"
|
|
|
|
RUN \
|
|
echo "**** install runtime packages ****" && \
|
|
apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
bzip2 \
|
|
curl \
|
|
jq \
|
|
libexpat1 \
|
|
netcat-openbsd && \
|
|
echo "**** install foldingathome ****" && \
|
|
if [ "${BUILD_ARCH}" = "aarch64" ]; then \
|
|
ARCH_PATTERN="arm64"; \
|
|
else \
|
|
ARCH_PATTERN="x86_64"; \
|
|
fi && \
|
|
DOWNLOAD_PATH=$(curl -fsSL "https://download.foldingathome.org/releases/public/fah-client/meta.json" | \
|
|
jq -r --arg arch "${ARCH_PATTERN}" \
|
|
'.[] | select((.package | contains("linux")) and (.package | contains("release")) and (.package | contains($arch)) and (.package | endswith(".tar.bz2"))) | .package' \
|
|
| head -1) && \
|
|
echo "Downloading FAH client: ${DOWNLOAD_PATH}" && \
|
|
curl -fsSL "https://download.foldingathome.org/releases/public/fah-client/${DOWNLOAD_PATH}" \
|
|
-o /tmp/fah.tar.bz2 && \
|
|
mkdir -p /app && \
|
|
tar xf /tmp/fah.tar.bz2 -C /app --strip-components=1 && \
|
|
echo "**** cleanup ****" && \
|
|
apt-get clean && \
|
|
rm -rf \
|
|
/tmp/* \
|
|
/var/lib/apt/lists/* \
|
|
/var/tmp/* \
|
|
/var/log/*
|
|
|
|
# Add local files
|
|
COPY root/ /
|
|
|
|
EXPOSE 7396
|