add build file

This commit is contained in:
Jay 2019-05-03 22:03:55 +08:00
parent e4205f68ab
commit 729fbc45a2
2 changed files with 20 additions and 0 deletions

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM golang:1.12-alpine as builder
WORKDIR /data
COPY . .
RUN apk add --no-cache make git ca-certificates \
make
FROM alpine:latest
RUN apk add --no-cache ca-certificates
WORKDIR /data
COPY --from=stage /data/ddns-svc /usr/bin
COPY config.default.yml config.yml
EXPOSE 10230
CMD ["/usr/bin/ddns-svc", "-f", "/data/config.yml"]

7
Makefile Normal file
View File

@ -0,0 +1,7 @@
.PHONY: clean build
build:
GOOS=linux go build -o ddns-svc -ldflags "-s -w" .
clean:
rm -rf ddns-svc && go clean