Files
ark/Dockerfile
Marco Argentieri faecf1a392 gha release: split docker and binaries. tag name as VERSION in build-arg (#256)
* client: print version

* arkd: add --version

* release action refactor
2024-08-15 04:52:04 +02:00

35 lines
889 B
Docker

# First image used to build the sources
FROM golang:1.21.0 AS builder
ARG VERSION
ARG TARGETOS
ARG TARGETARCH
WORKDIR /app
COPY . .
ENV GOPROXY=https://goproxy.io,direct
RUN cd server && CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-X 'main.Version=${VERSION}'" -o ../bin/arkd ./cmd/arkd
RUN cd client && CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-X 'main.Version=${VERSION}}'" -o ../bin/ark .
# Second image, running the arkd executable
FROM alpine:3.12
WORKDIR /app
COPY --from=builder /app/bin/* /app/
COPY --from=builder /app/server/internal/infrastructure/db/sqlite/migration/* /app/
ENV PATH="/app:${PATH}"
ENV ARK_DATADIR=/app/data
ENV ARK_WALLET_DATADIR=/app/wallet-data
ENV ARK_DB_MIGRATION_PATH=file://
# Expose volume containing all 'arkd' data
VOLUME /app/data
VOLUME /app/wallet-data
ENTRYPOINT [ "arkd" ]