diff --git a/.circleci/config.yml b/.circleci/config.yml index e99dff8..dd7b7a2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ jobs: - checkout - docker/build: image: pboehm/ddns - dockerfile: docker/ddns/Dockerfile + dockerfile: Dockerfile docker-build-and-push: executor: docker/docker @@ -28,7 +28,7 @@ jobs: - docker/check - docker/build: image: pboehm/ddns - dockerfile: docker/ddns/Dockerfile + dockerfile: Dockerfile tag: $CIRCLE_SHA1,latest - docker/push: image: pboehm/ddns diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..744fa3a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM golang:alpine AS builder + +RUN apk add --no-cache git + +WORKDIR /go/src/github.com/pboehm/ddns +COPY . . + +RUN GO111MODULE=on go get -d -v ./... +RUN export CGO_ENABLED=0 && GO111MODULE=on go install -v ./... + +ENV GIN_MODE release + +FROM scratch + +COPY --from=builder /go/bin/ddns /go/bin/ddns + +ENTRYPOINT ["/go/bin/ddns"]