mirror of
https://github.com/AuxXxilium/arc.git
synced 2026-09-03 06:36:32 +08:00
tree: add docker support for testing
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
37
.github/workflows/build.yml
vendored
37
.github/workflows/build.yml
vendored
@@ -32,6 +32,10 @@ on:
|
||||
description: "essential"
|
||||
default: false
|
||||
type: boolean
|
||||
docker:
|
||||
description: "push to Docker Hub"
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -184,6 +188,39 @@ jobs:
|
||||
(cd files && zip -r ../update-${{ env.ARC_VERSION }}.zip ./p1 ./p3)
|
||||
sha256sum update-${{ env.ARC_VERSION }}.zip >"update-${{ env.ARC_VERSION }}.hash"
|
||||
|
||||
# Build and push a qemux/qemu wrapper image with this release's
|
||||
# arc.img baked in, so `docker run` boots it with no manual
|
||||
# compose/volume setup. See docker.md for the details and the
|
||||
# manual (bind-mount) alternative.
|
||||
- name: Docker Login
|
||||
if: inputs.docker == true
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Docker Tags
|
||||
if: inputs.docker == true
|
||||
run: |
|
||||
TAGS=("auxxxilium/arc:${ARC_BRANCH}-${ARC_VERSION}")
|
||||
if [ "${{ inputs.stable }}" = "true" ]; then
|
||||
TAGS+=("auxxxilium/arc:${ARC_VERSION}" "auxxxilium/arc:latest")
|
||||
fi
|
||||
{
|
||||
echo "DOCKER_TAGS<<EOF"
|
||||
printf '%s\n' "${TAGS[@]}"
|
||||
echo "EOF"
|
||||
} >> $GITHUB_ENV
|
||||
|
||||
- name: Docker Build and Push
|
||||
if: inputs.docker == true
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
push: true
|
||||
tags: ${{ env.DOCKER_TAGS }}
|
||||
|
||||
# Beta Release
|
||||
- name: Beta Release
|
||||
if: inputs.beta == true
|
||||
|
||||
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
# Wraps a built arc.img in qemux/qemu so `docker run` boots it directly,
|
||||
# without users needing to write their own Compose file / volume mount.
|
||||
# See docker.md for the manual (bind-mount) alternative.
|
||||
FROM qemux/qemu:latest
|
||||
|
||||
COPY arc.img /arc.img
|
||||
|
||||
ENV BOOT=""
|
||||
ENV RAM_SIZE="4G"
|
||||
ENV CPU_CORES="2"
|
||||
ENV DISK_FMT="qcow2"
|
||||
ENV DISK_TYPE="sata"
|
||||
ENV DISK_SIZE="32G"
|
||||
ENV ARGUMENTS="-device nec-usb-xhci,id=usb0,multifunction=on -drive file=/arc.img,media=disk,format=raw,if=none,id=udisk1 -device usb-storage,bus=usb0.0,port=1,drive=udisk1,bootindex=999,removable=on"
|
||||
|
||||
# DSM management (5000/5001) and Arc's own web config/file-browser/terminal
|
||||
# (7080/7304/7681, matching HTTPPORT/DUFSPORT/TTYDPORT defaults) -- see
|
||||
# docker.md for the port meanings and how to remap them if you changed
|
||||
# these via the loader's "Change Loader Ports" menu.
|
||||
EXPOSE 5000 5001 7080 7304 7681
|
||||
73
docker.md
Normal file
73
docker.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# Running Arc in Docker
|
||||
|
||||
Arc can be run under Docker by running `arc.img` inside a full
|
||||
hardware-emulated VM ([qemux/qemu](https://github.com/qemus/qemu)) that lives
|
||||
inside a Docker container. QEMU (with `/dev/kvm` acceleration) boots the
|
||||
image exactly like real hardware would, and DSM runs inside that emulated
|
||||
machine. This is a normal, fully working way to run Arc + DSM.
|
||||
|
||||
## Option 1: Prebuilt image (quickest)
|
||||
|
||||
Every release with Docker Hub publishing enabled ships a ready-to-run image
|
||||
with `arc.img` already baked in — no manual disk setup needed:
|
||||
|
||||
```sh
|
||||
docker run -d --name arc \
|
||||
--device /dev/kvm --device /dev/net/tun \
|
||||
--cap-add NET_ADMIN \
|
||||
-p 5000:5000 -p 5001:5001 -p 7080:7080 -p 7304:7304 -p 7681:7681 \
|
||||
-v ./data:/storage \
|
||||
auxxxilium/arc:latest
|
||||
```
|
||||
|
||||
Use `auxxxilium/arc:<version>` instead of `:latest` to pin a specific
|
||||
release. See the [Dockerfile](Dockerfile) for exactly what this image sets.
|
||||
|
||||
## Option 2: Build and run your own image
|
||||
|
||||
Build `arc.img` first (see the main [README](README.md) / `img-gen.sh`), then
|
||||
run it with the following Docker Compose file:
|
||||
|
||||
```yaml
|
||||
version: "3.9"
|
||||
services:
|
||||
arc:
|
||||
image: qemux/qemu:latest
|
||||
container_name: arc
|
||||
environment:
|
||||
BOOT: ""
|
||||
RAM_SIZE: "4G" # >= 4G recommended for DSM
|
||||
CPU_CORES: "2"
|
||||
DISK_FMT: "qcow2"
|
||||
DISK_TYPE: "sata"
|
||||
DISK_SIZE: "32G" # data disk size
|
||||
ARGUMENTS: "-device nec-usb-xhci,id=usb0,multifunction=on -drive file=/arc.img,media=disk,format=raw,if=none,id=udisk1 -device usb-storage,bus=usb0.0,port=1,drive=udisk1,bootindex=999,removable=on"
|
||||
devices:
|
||||
- /dev/kvm
|
||||
- /dev/net/tun
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
ports:
|
||||
- 5000:5000 # DSM management
|
||||
- 5001:5001 # DSM management (HTTPS)
|
||||
- 7080:7080 # Arc web config (HTTPPORT)
|
||||
- 7304:7304 # Arc file browser (DUFSPORT)
|
||||
- 7681:7681 # Arc web terminal (TTYDPORT)
|
||||
volumes:
|
||||
- ./arc.img:/arc.img
|
||||
- ./data:/storage
|
||||
restart: always
|
||||
stop_grace_period: 2m
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- Replace `./arc.img` with the actual path to your built image.
|
||||
- The port list matches Arc's own defaults (`HTTP_PORT`/`DUFS_PORT`/`TTYD_PORT`
|
||||
in `/etc/arc.conf`, falling back to `7080`/`7304`/`7681`) plus DSM's own
|
||||
`5000`/`5001` once DSM has booted inside the VM. If you changed these via
|
||||
the loader's "Change Loader Ports" menu, update the port mappings to match.
|
||||
- `/dev/kvm` is required for hardware-accelerated virtualization; without it
|
||||
QEMU falls back to slow software emulation.
|
||||
- Once running, configure the loader at `http://<host>:7080` the same way
|
||||
you would on real hardware.
|
||||
@@ -325,7 +325,7 @@ if [ "${DIRECTBOOT}" = "true" ] || echo "parallels xen" | grep -qw "${MEV:-physi
|
||||
sleep 2
|
||||
|
||||
echo -e "\033[1;34mReboot with Directboot\033[0m"
|
||||
exec reboot
|
||||
[ ! -f "/.dockerenv" ] && exec reboot
|
||||
exit 0
|
||||
else
|
||||
grub-editenv ${USER_GRUBENVFILE} unset dsm_cmdline 2>/dev/null || true
|
||||
@@ -335,7 +335,9 @@ else
|
||||
[ -z "${BOOTIPWAIT}" ] && BOOTIPWAIT=20
|
||||
echo -e "\033[1;34mNetwork (${ETHN} NIC)\033[0m"
|
||||
RESTARTED=0
|
||||
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 && RESTARTED=1
|
||||
if [ ! -f "/.dockerenv" ]; then
|
||||
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 && RESTARTED=1
|
||||
fi
|
||||
[ "${RESTARTED}" = "1" ] && sleep 5
|
||||
IPCON=""
|
||||
checkNIC || true
|
||||
|
||||
@@ -208,7 +208,9 @@ BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
|
||||
[ -z "${BOOTIPWAIT}" ] && BOOTIPWAIT=30
|
||||
echo -e "\033[1;34mNetwork (${ETHN} NIC)\033[0m"
|
||||
RESTARTED=0
|
||||
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 && RESTARTED=1
|
||||
if [ ! -f "/.dockerenv" ]; then
|
||||
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 && RESTARTED=1
|
||||
fi
|
||||
[ ! -f /var/run/thttpd.pid ] && /etc/init.d/S90thttpd restart >/dev/null 2>&1 && RESTARTED=1
|
||||
[ "${RESTARTED}" = "1" ] && sleep 5
|
||||
IPCON=""
|
||||
@@ -248,14 +250,14 @@ fi
|
||||
|
||||
# Notification System
|
||||
WEBHOOKNOTIFY="$(readConfigKey "arc.webhooknotify" "${USER_CONFIG_FILE}")"
|
||||
if [ "${WEBHOOKNOTIFY}" = "true" ]; then
|
||||
if [ "${WEBHOOKNOTIFY}" = "true" ] && [ ! -f "/.dockerenv" ]; then
|
||||
WEBHOOKURL="$(readConfigKey "arc.webhookurl" "${USER_CONFIG_FILE}")"
|
||||
sendWebhook "${WEBHOOKURL}" "${ARC_MODE} is running @ ${IPCON}" || true
|
||||
echo -e "\033[1;34mWebhook Notification enabled.\033[0m"
|
||||
echo
|
||||
fi
|
||||
DISCORDNOTIFY="$(readConfigKey "arc.discordnotify" "${USER_CONFIG_FILE}")"
|
||||
if [ "${DISCORDNOTIFY}" = "true" ]; then
|
||||
if [ "${DISCORDNOTIFY}" = "true" ] && [ ! -f "/.dockerenv" ]; then
|
||||
DISCORDUSER="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
|
||||
if [ -n "${DISCORDUSER}" ]; then
|
||||
sendDiscord "${DISCORDUSER}" "${ARC_MODE} is running @ ${IPCON}" || true
|
||||
|
||||
Reference in New Issue
Block a user