@samitouri / QOSami-HFS / commits / c6da5d93

new docker image release process

Massimo Melina committed Jan 24, 2026 at 18:20 UTC c6da5d93143dde591d87e7b25e5f1640527b6d8d
4 files changed +147 -2
.dockerignore new
+16
@@ -0,0 +1,16 @@
1 +.git
2 +.github
3 +.node_modules
4 +node_modules
5 +admin/node_modules
6 +frontend/node_modules
7 +shared/node_modules
8 +mui-grid-form/node_modules
9 +**/*.log
10 +**/*.zip
11 +**/*.tgz
12 +**/*.exe
13 +dist
14 +playwright-report
15 +test-results
16 +tests/work
.github/workflows/docker-image.yml new
+66
@@ -0,0 +1,66 @@
1 +name: docker-image
2 +
3 +on:
4 + workflow_dispatch:
5 + inputs:
6 + version:
7 + description: 'Release tag (e.g., v3.0.2)'
8 + required: true
9 + type: string
10 + push:
11 + tags:
12 + - 'v*'
13 +
14 +permissions:
15 + contents: read
16 + packages: write
17 +
18 +jobs:
19 + build:
20 + runs-on: ubuntu-latest
21 + steps:
22 + - name: Checkout
23 + uses: actions/checkout@v4
24 +
25 + - name: Set up QEMU
26 + uses: docker/setup-qemu-action@v3
27 +
28 + - name: Set up Docker Buildx
29 + uses: docker/setup-buildx-action@v3
30 +
31 + - name: Log in to GHCR
32 + uses: docker/login-action@v3
33 + with:
34 + registry: ghcr.io
35 + username: ${{ github.actor }}
36 + password: ${{ secrets.GITHUB_TOKEN }}
37 +
38 + - name: Log in to Docker Hub
39 + uses: docker/login-action@v3
40 + with:
41 + username: rejetto
42 + password: ${{ secrets.DOCKERHUB_TOKEN }}
43 +
44 + - name: Docker metadata
45 + id: meta
46 + uses: docker/metadata-action@v5
47 + with:
48 + images: |
49 + ghcr.io/${{ github.repository }}
50 + docker.io/rejetto/hfs
51 + tags: |
52 + type=ref,event=tag
53 + type=raw,value=latest,enable=${{ github.ref_type == 'tag' }}
54 + type=sha
55 +
56 + - name: Build and push
57 + uses: docker/build-push-action@v6
58 + with:
59 + context: .
60 + file: ./Dockerfile
61 + platforms: linux/amd64,linux/arm64
62 + push: true
63 + build-args: |
64 + HFS_VERSION=${{ inputs.version || github.ref_name }}
65 + tags: ${{ steps.meta.outputs.tags }}
66 + labels: ${{ steps.meta.outputs.labels }}
Dockerfile new
+61
@@ -0,0 +1,61 @@
1 +FROM debian:bookworm-slim
2 +
3 +ARG HFS_VERSION
4 +ARG TARGETARCH
5 +
6 +WORKDIR /opt/hfs
7 +
8 +RUN apt-get update \
9 + && apt-get install -y --no-install-recommends ca-certificates curl unzip \
10 + && rm -rf /var/lib/apt/lists/*
11 +
12 +RUN set -eux; \
13 + version="${HFS_VERSION#v}"; \
14 + case "$TARGETARCH" in \
15 + amd64) arch="x64" ;; \
16 + arm64) arch="arm64" ;; \
17 + *) echo "unsupported TARGETARCH: $TARGETARCH" >&2; exit 1 ;; \
18 + esac; \
19 + url="https://github.com/rejetto/hfs/releases/download/v${version}/hfs-linux-${arch}-${version}.zip"; \
20 + curl -fsSL "$url" -o hfs.zip; \
21 + unzip hfs.zip; \
22 + rm hfs.zip
23 +
24 +RUN cat <<'EOF' > /opt/hfs/docker-entrypoint.sh \
25 + && chmod +x /opt/hfs/docker-entrypoint.sh
26 +#!/bin/sh
27 +set -e
28 +
29 +bootstrap_config() {
30 + cwd="$1"
31 + config="$cwd/config.yaml"
32 + [ -f "$config" ] && return
33 +
34 + mkdir -p "$cwd"
35 + {
36 + admin_pw="${HFS_CREATE_ADMIN:-please-change}"
37 + esc="$(printf '%s' "$admin_pw" | sed "s/'/''/g")"
38 + printf "create-admin: '%s'\\n" "$esc"
39 + printf "vfs:\\n source: /shares\\n"
40 + } > "$config"
41 +}
42 +
43 +if [ -n "${HFS_CWD:-}" ]; then
44 + bootstrap_config "$HFS_CWD"
45 + exec /opt/hfs/hfs --cwd "$HFS_CWD" "$@"
46 +fi
47 +
48 +# Legacy compatibility: keep older images working (config mounted at /home/hfs/.hfs).
49 +if [ -d /home/hfs/.hfs ] || [ -f /home/hfs/.hfs/config.yaml ]; then
50 + bootstrap_config /home/hfs/.hfs
51 + exec /opt/hfs/hfs --cwd /home/hfs/.hfs "$@"
52 +fi
53 +
54 +bootstrap_config /data
55 +exec /opt/hfs/hfs --cwd /data "$@"
56 +EOF
57 +
58 +EXPOSE 80
59 +VOLUME ["/data"]
60 +
61 +ENTRYPOINT ["/opt/hfs/docker-entrypoint.sh"]
README.md
+4 -2
@@ -66,9 +66,11 @@ Runs on: Windows, Linux, macOS, FreeBSD, Android
66
67 ## Installation
68
69 -If you need [Docker installation](https://github.com/damienzonly/hfs-docker) or [Service installation](https://github.com/rejetto/hfs/wiki/Service-installation), click the links.
69 +For Docker, see https://github.com/rejetto/hfs/wiki/Docker .
70
71 -Minimum Windows version required is 10 or Server 2019.
71 +For service installation, see https://github.com/rejetto/hfs/wiki/Service-installation.
72 +
73 +The minimum Windows version required is 10 or Server 2019.
74
75 1. Download the zip file for your operating system from https://github.com/rejetto/hfs/releases
76 - ⚠️ Antivirus problems on Windows? [READ THIS](https://github.com/rejetto/hfs/wiki/Antivirus)