mirror of
https://github.com/datarhei/core.git
synced 2025-09-27 12:22:28 +08:00
Don't trim paths in normal build
This commit is contained in:
39
Dockerfile.debug
Normal file
39
Dockerfile.debug
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
ARG GOLANG_IMAGE=golang:1.22-alpine3.20
|
||||||
|
ARG BUILD_IMAGE=alpine:3.20
|
||||||
|
|
||||||
|
# Cross-Compilation
|
||||||
|
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
|
||||||
|
FROM --platform=$BUILDPLATFORM $GOLANG_IMAGE AS builder
|
||||||
|
|
||||||
|
ARG TARGETOS TARGETARCH TARGETVARIANT
|
||||||
|
ENV GOOS=$TARGETOS GOARCH=$TARGETARCH GOARM=$TARGETVARIANT
|
||||||
|
|
||||||
|
COPY . /dist/core
|
||||||
|
|
||||||
|
RUN apk add \
|
||||||
|
git \
|
||||||
|
make
|
||||||
|
|
||||||
|
RUN cd /dist/core && \
|
||||||
|
make build && \
|
||||||
|
make import && \
|
||||||
|
make ffmigrate && \
|
||||||
|
mv core-* core
|
||||||
|
|
||||||
|
FROM $BUILD_IMAGE
|
||||||
|
|
||||||
|
COPY --from=builder /dist/core/core /core/bin/core
|
||||||
|
COPY --from=builder /dist/core/import /core/bin/import
|
||||||
|
COPY --from=builder /dist/core/ffmigrate /core/bin/ffmigrate
|
||||||
|
COPY --from=builder /dist/core/mime.types /core/mime.types
|
||||||
|
COPY --from=builder /dist/core/run.sh /core/bin/run.sh
|
||||||
|
|
||||||
|
RUN mkdir /core/config /core/data
|
||||||
|
|
||||||
|
ENV CORE_CONFIGFILE=/core/config/config.json
|
||||||
|
ENV CORE_STORAGE_DISK_DIR=/core/data
|
||||||
|
ENV CORE_DB_DIR=/core/config
|
||||||
|
|
||||||
|
VOLUME ["/core/data", "/core/config"]
|
||||||
|
ENTRYPOINT ["/core/bin/run.sh"]
|
||||||
|
WORKDIR /core
|
2
Makefile
2
Makefile
@@ -16,7 +16,7 @@ init:
|
|||||||
|
|
||||||
## build: Build core (default)
|
## build: Build core (default)
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build -o core$(BINSUFFIX) -trimpath
|
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build -o core$(BINSUFFIX)
|
||||||
|
|
||||||
## swagger: Update swagger API documentation (requires github.com/swaggo/swag)
|
## swagger: Update swagger API documentation (requires github.com/swaggo/swag)
|
||||||
swagger:
|
swagger:
|
||||||
|
Reference in New Issue
Block a user