From 58908e29de5fade117b04c93c2cb2a80ee04f7b6 Mon Sep 17 00:00:00 2001 From: Marvin Steadfast Date: Mon, 18 Jan 2021 10:06:39 +0100 Subject: [PATCH] adds dockerfile --- .drone.yml | 31 +++++++++++++++++++++++++++++++ Dockerfile | 13 +++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..1f4c07d --- /dev/null +++ b/.drone.yml @@ -0,0 +1,31 @@ +--- +kind: pipeline +name: default + +steps: + - name: fetch + image: docker:git + commands: + - git fetch --tags + + - name: build + image: plugins/docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: quay.io/xsteadfastx/govanityurls + registry: quay.io + +services: + - name: docker + image: docker:dind + privileged: true + volumes: + - name: dockersock + path: /var/run + +volumes: + - name: dockersock + temp: {} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..369e583 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:alpine AS build + +WORKDIR /go/src/app +COPY . . + +RUN set -ex \ + && CGO_ENABLED=0 go install -a -ldflags '-w -s -extldflags "-static"' + +FROM scratch + +COPY --from=build /go/bin/govanityurls /govanityurls + +ENTRYPOINT ["/govanityurls"]