3 Commits

Author SHA1 Message Date
lerko 8d34524aa0 fix(docker): create .ssh dir explicitly, ensure entrypoint is executable
CI / test (pull_request) Successful in 2m31s
CI / lint (pull_request) Successful in 1m6s
CI / vulncheck (pull_request) Successful in 1m6s
2026-06-01 15:56:45 -04:00
lerko b254f6ea05 fix(docker): move SSH host key path into /data for non-root user
CI / test (pull_request) Successful in 2m26s
CI / lint (pull_request) Successful in 40s
CI / vulncheck (pull_request) Successful in 41s
2026-06-01 15:33:52 -04:00
lerko 87270490de fix(docker): non-root user, supply chain attestations, build cleanup
CI / test (pull_request) Successful in 2m29s
CI / lint (pull_request) Successful in 46s
CI / vulncheck (pull_request) Successful in 41s
BREAKING: Container now runs as UID 1000 (uptop) instead of root.
Existing volumes with root-owned files need migration:

  docker run --rm -v <volume>:/data alpine chown -R 1000:1000 /data

- Add uptop user (UID/GID 1000) with entrypoint writability check
- Enable SBOM and provenance attestations for Docker Scout compliance
- Prune dangling images and build cache after release builds
2026-06-01 11:46:05 -04:00
3 changed files with 28 additions and 3 deletions
+8
View File
@@ -66,6 +66,8 @@ jobs:
context: .
push: true
platforms: linux/amd64,linux/arm64
sbom: true
provenance: mode=max
tags: |
lerkolabs/uptop:${{ github.ref_name }}
lerkolabs/uptop:latest
@@ -80,3 +82,9 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: lerkolabs/uptop
- name: Cleanup Docker artifacts
if: always()
run: |
docker image prune -f
docker builder prune -f --keep-storage=2GB
+6 -3
View File
@@ -18,17 +18,20 @@ RUN --mount=type=cache,target=/go/pkg/mod \
FROM alpine:3.23
WORKDIR /app
RUN apk add --no-cache ca-certificates && apk upgrade --no-cache
RUN mkdir /data
RUN addgroup -g 1000 -S uptop && adduser -u 1000 -S uptop -G uptop
RUN mkdir -p /data/.ssh && chown -R uptop:uptop /data
COPY --from=builder /app/uptop .
COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/
# Set Default Configuration via ENV
# Docker users can override these in docker-compose.yml
ENV LIPGLOSS_RENDERER_HAS_DARK_BACKGROUND=true
ENV UPTOP_DB_TYPE=sqlite
ENV UPTOP_DB_DSN=/data/uptop.db
ENV UPTOP_KEYS=/data/authorized_keys
ENV UPTOP_SSH_HOST_KEY=/data/.ssh/id_ed25519
ENV UPTOP_PORT=23234
EXPOSE 23234
USER uptop
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["./uptop"]
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
set -e
if [ ! -w /data ]; then
echo "ERROR: /data is not writable by uptop user (UID $(id -u))." >&2
echo "" >&2
echo "If upgrading from a previous version that ran as root:" >&2
echo " docker run --rm -v <your_volume>:/data alpine chown -R 1000:1000 /data" >&2
exit 1
fi
mkdir -p /data/.ssh
exec "$@"