Enforce environment variable configuration for Docker entrypoint
CI / Go Tests (push) Successful in 12s
CI / Build (push) Successful in 11s
Format / gofmt (push) Successful in 6s
Release Artifacts / Validate release tag (push) Successful in 2s
Release Artifacts / Build and release executables (push) Successful in 16s
Release Artifacts / Build and release Docker image (push) Successful in 26s

- Updated `docker-entrypoint.sh` to disallow custom command-line arguments, requiring configuration through `SCRATCHBOX_*` environment variables.
- Modified `README.md` to clarify that custom container commands are not supported and to reflect the new entrypoint behavior.
- Enhanced `main_test.go` to validate failure when required environment variables are not set.
- Added a function in `server.go` to print startup environment variables, ensuring visibility of configuration during server initialization.
This commit is contained in:
2026-06-01 05:06:57 -05:00
parent 0dc1df2ded
commit 4579443d09
5 changed files with 57 additions and 13 deletions
+1 -4
View File
@@ -51,14 +51,11 @@ Use the included Compose example:
Inside the container, the default command is:
- `scratchbox server --env`
- Custom container command/args are not supported; configure behavior via `SCRATCHBOX_*` env vars.
- The image forces `SCRATCHBOX_STORAGE_DATA_DIR=/data`.
- The image forces `SCRATCHBOX_SERVER_LISTEN_ADDR=:8080`.
- The image forces `SCRATCHBOX_SERVER_ACCESS_LOG_FILE_PATH` to empty.
To run with a YAML config instead, pass `--config` explicitly (mutually exclusive with `--env`):
- `docker run --rm -p 8080:8080 -v "$(pwd)/docker-data:/data" -v "$(pwd)/docker-config:/config" scratchbox:dev server --config /config/config.yaml`
Storage encryption key behavior:
- The key file is always stored at `storage.data_dir/metadata.key` (next to `metadata`).