mirror of
https://github.com/paralus/paralus.git
synced 2026-04-19 16:16:43 +00:00
Reduce go binary size be removing symbol table
Optimize binary file size to perform deployment faster.
This commit is contained in:
@@ -8,9 +8,9 @@ COPY go.sum .
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN go build github.com/paralus/paralus
|
||||
RUN make build
|
||||
|
||||
FROM alpine:latest as runtime
|
||||
FROM scratch as runtime
|
||||
LABEL description="Run container"
|
||||
|
||||
COPY --from=build /build/paralus /usr/bin/paralus
|
||||
@@ -19,5 +19,9 @@ WORKDIR /usr/bin
|
||||
# TODO: Support paralus binary to run migrations
|
||||
COPY ./persistence/migrations/admindb /data/migrations/admindb
|
||||
|
||||
# RPC port
|
||||
EXPOSE 10000
|
||||
# RPC relay peering port
|
||||
EXPOSE 10001
|
||||
# HTTP port
|
||||
EXPOSE 11000
|
||||
|
||||
@@ -4,9 +4,9 @@ LABEL description="Build container"
|
||||
ENV CGO_ENABLED 0
|
||||
COPY . /build
|
||||
WORKDIR /build
|
||||
RUN go build -o paralus-init scripts/initialize/main.go
|
||||
RUN go build -ldflags "-s" -o paralus-init scripts/initialize/main.go
|
||||
|
||||
FROM alpine:latest as runtime
|
||||
FROM scratch as runtime
|
||||
LABEL description="Run container"
|
||||
|
||||
WORKDIR /usr/bin
|
||||
|
||||
@@ -4,9 +4,9 @@ LABEL description="Build container"
|
||||
ENV CGO_ENABLED 0
|
||||
COPY . /build
|
||||
WORKDIR /build
|
||||
RUN go build -o start-sync scripts/kratos/providers_sync.go
|
||||
RUN go build -ldflags "-s" -o start-sync scripts/kratos/providers_sync.go
|
||||
|
||||
FROM alpine:latest as runtime
|
||||
FROM scratch as runtime
|
||||
LABEL description="Run container"
|
||||
|
||||
WORKDIR /usr/bin
|
||||
|
||||
Reference in New Issue
Block a user