fix drone.yml
This commit is contained in:
+5
-7
@@ -3,27 +3,25 @@
|
||||
FROM golang:1.11 AS build
|
||||
|
||||
# Load repository into docker
|
||||
WORKDIR /go/src/git.aiterp.net/rpdata/logbot3/
|
||||
WORKDIR /project
|
||||
COPY . .
|
||||
RUN rm -rf ./vendor
|
||||
|
||||
# Load and run dependencies
|
||||
RUN go get -u github.com/golang/dep/cmd/dep
|
||||
RUN dep ensure
|
||||
RUN go get
|
||||
|
||||
# Build server and tools (CGO disabled to make them 100% static)
|
||||
ENV CGO_ENABLED 0
|
||||
RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/logbot3 .
|
||||
RUN go build -a -installsuffix cgo -ldflags="-s -w" -o logbot3 .
|
||||
|
||||
## 2. Distribute
|
||||
# Use alpine linux
|
||||
FROM alpine:3.8 as main-dist
|
||||
FROM alpine:3.12 as main-dist
|
||||
|
||||
# Install certificates to enable HTTPS GET requests
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
# Copy build files into final container
|
||||
COPY --from=build /binaries/* /usr/local/bin/
|
||||
COPY --from=build /project/logbot3 /usr/local/bin/
|
||||
|
||||
# The server is the main entry point
|
||||
CMD ["/usr/local/bin/logbot3"]
|
||||
|
||||
Reference in New Issue
Block a user