Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

feat(docker): default CMD to `mini -dir=/data` for service-container use (#9255)

Chris Lue4a635a04ddf
diff --git a/docker/Dockerfile.go_build b/docker/Dockerfile.go_build
index a80a3cdef7..051831dd76 100644
--- a/docker/Dockerfile.go_build
+++ b/docker/Dockerfile.go_build
@@ -89,3 +89,8 @@ WORKDIR /data
# Entrypoint will handle permission fixes and user switching
ENTRYPOINT ["/entrypoint.sh"]
+# Default to a complete single-process cluster (master+volume+filer+S3+admin)
+# so the image is usable out of the box — including in environments like
+# GitHub Actions service containers that cannot pass arguments to the entrypoint.
+# Override with any other subcommand at `docker run` / compose time.
+CMD ["mini", "-dir=/data"]
diff --git a/docker/Dockerfile.local b/docker/Dockerfile.local
index c37e5f78ac..a275cc639d 100644
--- a/docker/Dockerfile.local
+++ b/docker/Dockerfile.local
@@ -40,3 +40,8 @@ WORKDIR /data
# Entrypoint will handle permission fixes and user switching
ENTRYPOINT ["/entrypoint.sh"]
+# Default to a complete single-process cluster (master+volume+filer+S3+admin)
+# so the image is usable out of the box — including in environments like
+# GitHub Actions service containers that cannot pass arguments to the entrypoint.
+# Override with any other subcommand at `docker run` / compose time.
+CMD ["mini", "-dir=/data"]
diff --git a/docker/Dockerfile.rocksdb_large b/docker/Dockerfile.rocksdb_large
index 6013aacf91..0274d29405 100644
--- a/docker/Dockerfile.rocksdb_large
+++ b/docker/Dockerfile.rocksdb_large
@@ -68,3 +68,8 @@ WORKDIR /data
# Entrypoint will handle permission fixes and user switching
ENTRYPOINT ["/entrypoint.sh"]
+# Default to a complete single-process cluster (master+volume+filer+S3+admin)
+# so the image is usable out of the box — including in environments like
+# GitHub Actions service containers that cannot pass arguments to the entrypoint.
+# Override with any other subcommand at `docker run` / compose time.
+CMD ["mini", "-dir=/data"]
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index 6632f66454..7ce0595ecd 100755
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -37,17 +37,21 @@ if [ "$(id -u)" = "0" ]; then
fi
isArgPassed() {
+ # Match both `-flag` and `--flag` (and their `=value` forms): the Go fla9
+ # library accepts both, and users may pick either form on the CLI.
arg="$1"
argWithEqualSign="$1="
+ argDouble="-$1"
+ argDoubleWithEqualSign="-$1="
shift
while [ $# -gt 0 ]; do
passedArg="$1"
shift
case $passedArg in
- "$arg")
+ "$arg"|"$argDouble")
return 0
;;
- "$argWithEqualSign"*)
+ "$argWithEqualSign"*|"$argDoubleWithEqualSign"*)
return 0
;;
esac
@@ -95,6 +99,15 @@ case "$1" in
exec /usr/bin/weed -logtostderr=true server $ARGS $@
;;
+ 'mini')
+ ARGS="-dir=/data"
+ if isArgPassed "-dir" "$@"; then
+ ARGS=""
+ fi
+ shift
+ exec /usr/bin/weed -logtostderr=true mini $ARGS $@
+ ;;
+
'filer')
ARGS=""
shift