# auxxxilium/arc and auxxxilium/arx: one Dockerfile, LOADER picks which.
#
#   docker build --build-arg LOADER=arc -t auxxxilium/arc docker/
#   docker build --build-arg LOADER=arx --build-arg PORTS="5000 5001 7080" -t auxxxilium/arx docker/
#
# No loader inside: the first start downloads the latest release into the
# /storage volume (see arcvm.sh), and the volume keeps it from then on.

FROM alpine:3.24
ARG LOADER=arc
ARG PORTS="5000 5001 7080 7304 7681"

RUN apk add --no-cache bash coreutils curl jq unzip mtools sfdisk socat iproute2 \
      qemu-system-x86_64 qemu-img seabios-bin ovmf
COPY arcvm.sh /usr/local/bin/arcvm

ENV LOADER=${LOADER} \
    LOADER_VERSION=latest \
    RAM_SIZE=4G \
    CPU_CORES=2 \
    DISK_SIZE=32G \
    NETWORK=user \
    AUTO_UPDATE=0

VOLUME /storage
EXPOSE ${PORTS}
STOPSIGNAL SIGTERM
ENTRYPOINT ["/usr/local/bin/arcvm"]
