Files
eleith 5346483a99 initial cadvisor add-on
1. fork cadvisor from caraar12345
2. remove s6 overlay to use host_pid option
2025-05-20 11:24:01 -07:00

55 lines
2.1 KiB
Docker

ARG BUILD_FROM=ghcr.io/hassio-addons/base:17.2.5
FROM ${BUILD_FROM}
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY --from=gcr.io/cadvisor/cadvisor:v0.52.1 /usr/bin/cadvisor /usr/bin/cadvisor
#COPY --from=gcr.io/cadvisor/cadvisor:v0.52.1 /usr/local/lib/libipmctl.so* /usr/local/lib/
#COPY --from=gcr.io/cadvisor/cadvisor:v0.52.1 /usr/local/lib/libpfm.so* /usr/local/lib/
COPY --from=gcr.io/cadvisor/cadvisor:v0.52.1 /usr/local/lib/lib* /usr/local/lib/
RUN apk --no-cache add docker libc6-compat device-mapper findutils ndctl zfs && \
apk --no-cache add thin-provisioning-tools --repository https://dl-cdn.alpinelinux.org/alpine/edge/main/ && \
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
rm -rf /var/cache/apk/*
# Copy root filesystem
COPY rootfs /
RUN chmod +x /usr/bin/run_cadvisor.sh && \
chmod +x /usr/bin/cadvisor && \
chmod +x /init && \
chmod +x /etc/cont-init.d/cadvisor.sh && \
chmod +x /etc/services.d/cadvisor/run
# This add-on runs on the host pid namespace, making it impossible
# to use S6-Overlay. Therefore the init system is disabled at this point.
CMD ["/usr/bin/run_cadvisor.sh"]
# Build arguments
ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_DESCRIPTION
ARG BUILD_NAME
ARG BUILD_REF
ARG BUILD_REPOSITORY
ARG BUILD_VERSION
# Labels
LABEL \
io.hass.name="cAdvisor" \
io.hass.description="Add-on for cAdvisor" \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="https://git.eleith.com/eleith/hassos-addons" \
org.label-schema.description="Add-on for cAdvisor" \
org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.name="cAdvisor" \
org.label-schema.schema-version="v0.52.1" \
org.label-schema.url="https://git.eleith.com/eleith/hassos-addons" \
org.label-schema.usage="https://git.eleith.com/eleith/hassos-addons" \
org.label-schema.vcs-ref=${BUILD_REF} \
org.label-schema.vcs-url="https://git.eleith.com/eleith/hassos-addons" \
org.label-schema.vendor="https://git.eleith.com/eleith"