From 9d4149d8a27c2bd7b7679cab25c03f89e742c33a Mon Sep 17 00:00:00 2001 From: Anton Zadvorny Date: Sat, 2 Feb 2019 15:04:44 +0300 Subject: [PATCH] Initialize golang build image --- .drone.yml | 17 +++++++++++++++++ Dockerfile | 25 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..740e972 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,17 @@ +kind: pipeline +name: default + +clone: + depth: 50 + +steps: +- name: docker + image: plugins/docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + registry: r.pkg.cx + repo: r.pkg.cx/build/go + auto_tag: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f23db87 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM golang:1.11-alpine + +ENV TZ=Europe/Moscow +ENV TERM=xterm-color +ENV CGO_ENABLED=0 +ENV GOOS=linux +ENV GOARCH=amd64 +ENV GOLANGCI=1.13 + +RUN \ + apk add --no-cache --update bash curl git tzdata && \ + rm -rf /var/cache/apk/* + +RUN \ + cp /usr/share/zoneinfo/${TZ} /etc/localtime && \ + echo "${TZ}" > /etc/timezone && date + +RUN \ + go get -u -v github.com/golangci/golangci-lint/cmd/golangci-lint && \ + cd /go/src/github.com/golangci/golangci-lint && \ + git checkout v${GOLANGCI} && \ + cd /go/src/github.com/golangci/golangci-lint/cmd/golangci-lint && \ + go install -ldflags "-X 'main.version=$(git describe --tags)' -X 'main.commit=$(git rev-parse --short HEAD)' -X 'main.date=$(date)'" && \ + go version && \ + golangci-lint --version