A continuation of HomeBox the inventory and organization system built for the Home User
Hopefully fixed ARMv7 Rootless build
Matthew Kilgore1fd2f42282fd
diff --git a/Dockerfile.rootless b/Dockerfile.rootlessindex 8cf9589a..06a5737d 100644--- a/Dockerfile.rootless+++ b/Dockerfile.rootless@@ -31,6 +31,8 @@ RUN go mod download# Build API stageFROM public.ecr.aws/docker/library/golang:alpine AS builder+ARG TARGETOS+ARG TARGETARCHARG BUILD_TIMEARG COMMITARG VERSION@@ -38,7 +40,8 @@ ARG VERSION# Install necessary build toolsRUN apk update && \apk upgrade && \- apk add --no-cache git build-base gcc g+++ apk add --no-cache git build-base gcc g++ && \+ if [ "$TARGETARCH" != "arm" ] || [ "$TARGETARCH" != "riscv64" ]; then apk --no-cache add libwebp libavif libheif libjxl; fiWORKDIR /go/src/app@@ -53,11 +56,11 @@ COPY --from=frontend-builder /app/.output/public ./app/api/static/public# Use cache for Go build artifactsRUN --mount=type=cache,target=/root/.cache/go-build \if [ "$TARGETARCH" = "arm" ] || [ "$TARGETARCH" = "riscv64" ]; \- then CGO_ENABLED=0 GOOS=linux go build \+ then echo "nodynamic" $TARGETOS $TARGETARCH; CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build \-ldflags "-s -w -X main.commit=$COMMIT -X main.buildTime=$BUILD_TIME -X main.version=$VERSION" \-tags nodynamic -o /go/bin/api -v ./app/api/*.go; \else \- CGO_ENABLED=0 GOOS=linux go build \+ echo $TARGETOS $TARGETARCH; CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build \-ldflags "-s -w -X main.commit=$COMMIT -X main.buildTime=$BUILD_TIME -X main.version=$VERSION" \-o /go/bin/api -v ./app/api/*.go; \fi@@ -73,7 +76,7 @@ ENV HBOX_DATABASE_SQLITE_PATH=/data/homebox.db?_pragma=busy_timeout=2000&_pragma# Install necessary runtime dependenciesRUN apk --no-cache add ca-certificates wget && \- if [ "$TARGETARCH" != "arm" ] || [ "$TARGETARCH" != "riscv64" ]; then apk --no-cache add libwebp libavif; fi+ if [ "$TARGETARCH" != "arm" ] || [ "$TARGETARCH" != "riscv64" ]; then apk --no-cache add libwebp libavif libheif libjxl; fi# Create a nonroot user with UID/GID 65532RUN addgroup -g 65532 nonroot && adduser -u 65532 -G nonroot -S nonrootdiff --git a/docker-compose.yml b/docker-compose.ymlindex 1c41cef1..f576b709 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -3,7 +3,7 @@ services:image: homeboxbuild:context: .- dockerfile: ./Dockerfile+ dockerfile: ./Dockerfile.rootlessargs:- COMMIT=head- BUILD_TIME=0001-01-01T00:00:00Z