Containerfile.pkg.j2
Rama main · réplica de lectura del repositorio original.
ARG BASE_VERSION=15.1
FROM ghcr.io/daemonless/base-rcd:${BASE_VERSION}
ARG FREEBSD_ARCH=amd64
ARG PKG_NAME=unifi10
LABEL org.opencontainers.image.title="{{ title }}" \
org.opencontainers.image.description="{{ description }}" \
org.opencontainers.image.source="{{ repo_url }}" \
org.opencontainers.image.url="{{ web_url }}" \
org.opencontainers.image.documentation="https://help.ui.com/" \
org.opencontainers.image.licenses="Proprietary" \
org.opencontainers.image.vendor="daemonless" \
org.opencontainers.image.authors="daemonless" \
{%- if ports %}
io.daemonless.port="{{ ports[0].port }}" \
{%- endif %}
io.daemonless.arch="${FREEBSD_ARCH}" \
io.daemonless.pkg-name="${PKG_NAME}" \
{%- if mlock %}
org.freebsd.jail.allow.mlock="required"
{%- endif %}
# Install from FreeBSD packages
RUN pkg update && \
pkg install -y ${PKG_NAME} && \
UNIFI_VERSION=$(pkg info ${PKG_NAME} | sed -n 's/.*Version.*: *//p') && \
mkdir -p /app && echo "$UNIFI_VERSION" > /app/version && \
pkg clean -ay && \
rm -rf /var/cache/pkg/* /var/db/pkg/repos/*
# Create config directory and symlink data dir
# UniFi installs to /usr/local/share/java/unifi
RUN mkdir -p /config /var/run/unifi && \
rm -rf /usr/local/share/java/unifi/data && \
ln -sf /config /usr/local/share/java/unifi/data && \
chown -R bsd:bsd /config /var/run/unifi /usr/local/share/java/unifi
# Copy service definition and init scripts
COPY root/ /
RUN chmod +x /daemonless/libexec/* /daemonless/init.d/*
# UniFi ports:
# 8443 - Web UI (HTTPS)
# 8080 - Device inform
# 8843 - Guest portal HTTPS
# 8880 - Guest portal HTTP
# 6789 - Mobile throughput test
# 3478/udp - STUN
# 10001/udp - Device discovery
{%- if ports %}
EXPOSE {{ ports | map(attribute='port') | join(' ') }}
{%- endif %}
{%- if volumes %}
VOLUME {{ volumes | map(attribute='path') | join(' ') }}
{%- endif %}