test
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
41daeab7b0
commit
a8df0d9ec2
|
@ -8,6 +8,7 @@ RUN go mod download
|
||||||
WORKDIR /go/src
|
WORKDIR /go/src
|
||||||
ADD . .
|
ADD . .
|
||||||
RUN go mod tidy
|
RUN go mod tidy
|
||||||
|
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o api_example_api ./app/api/example_api
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o api_example_api ./app/api/example_api
|
||||||
FROM alpine as example_api
|
FROM alpine as example_api
|
||||||
WORKDIR /go/src
|
WORKDIR /go/src
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
FROM golang:1.17 as builder
|
||||||
|
ENV GO111MODULE on
|
||||||
|
ENV GOPROXY https://goproxy.io,direct
|
||||||
|
WORKDIR /go/cache
|
||||||
|
ADD go.mod .
|
||||||
|
ADD go.sum .
|
||||||
|
RUN go mod download
|
||||||
|
WORKDIR /go/src
|
||||||
|
ADD . .
|
||||||
|
RUN go mod tidy
|
||||||
|
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o service_example_service ./app/api/example_ervice
|
||||||
|
FROM alpine as example_service
|
||||||
|
WORKDIR /go/src
|
||||||
|
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
|
||||||
|
COPY --from=builder /go/src/service_example_service ./
|
||||||
|
ENV TZ=Asia/Shanghai
|
||||||
|
ENV env=pro
|
||||||
|
ENV endpoints=http://etcd-server:2379
|
||||||
|
RUN chmod +x ./service_example_service
|
||||||
|
LABEL io.portainer.accesscontrol.teams="admin"
|
||||||
|
EXPOSE 8080
|
||||||
|
CMD ["./service_example_service"]
|
Loading…
Reference in New Issue