File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,12 +3,20 @@ WORKDIR /src
33COPY go.mod go.sum ./
44RUN go mod download
55RUN go install github.com/google/wire/cmd/wire@latest
6- RUN apk update
7- RUN apk add --no-cache make
6+ ARG APK_MIRROR
7+ RUN if [ -n "$APK_MIRROR" ]; then \
8+ sed -i "s|https://dl-cdn.alpinelinux.org/alpine|$APK_MIRROR|g" /etc/apk/repositories; \
9+ fi
10+ RUN apk update && apk add --no-cache make gcc musl-dev
811COPY . .
9- RUN make
12+ RUN CGO_ENABLED=1 make
1013
1114FROM alpine
15+ ARG APK_MIRROR
16+ RUN if [ -n "$APK_MIRROR" ]; then \
17+ sed -i "s|https://dl-cdn.alpinelinux.org/alpine|$APK_MIRROR|g" /etc/apk/repositories; \
18+ fi
19+ RUN apk update && apk add --no-cache musl
1220COPY --from=build /src/csdmpro /usr/local/bin/
1321RUN mkdir /csdmpro
1422WORKDIR /csdmpro
Original file line number Diff line number Diff line change 1+ CGO_ENABLED ?= 0
2+ CC ?= gcc
13GO_FILES = $(shell find core -type f -name '* .go') \
24 $(shell find tg -type f -name '* .go') \
35 $(shell find db -type f -name '* .go') \
@@ -11,7 +13,7 @@ wire: $(GO_FILES) $(DEV_GO_FILES)
1113 wire
1214
1315build : $(GO_FILES ) $(DEV_GO_FILES ) wire
14- go build
16+ CGO_ENABLED= $( CGO_ENABLED ) CC= $( CC ) go build
1517
1618build_watch : $(GO_FILES )
1719 printf " %s\n" $(GO_FILES ) $(DEV_GO_FILES ) | \
You can’t perform that action at this time.
0 commit comments