Add Docker build files
This commit is contained in:
parent
26fcc06075
commit
30a5d407e2
2 changed files with 40 additions and 0 deletions
17
.drone.yml
17
.drone.yml
|
@ -25,3 +25,20 @@ steps:
|
|||
- curl -sL https://git.io/goreleaser | bash
|
||||
when:
|
||||
event: tag
|
||||
- name: build docker image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
username:
|
||||
from_secret: username
|
||||
password:
|
||||
from_secret: password
|
||||
repo: registry.git.tdem.in/gmnhg
|
||||
registry: registry.git.tdem.in
|
||||
dockerfile: Dockerfile
|
||||
tags:
|
||||
- ${DRONE_TAG}
|
||||
- latest
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
||||
|
|
23
Dockerfile
Normal file
23
Dockerfile
Normal file
|
@ -0,0 +1,23 @@
|
|||
FROM golang:1.15-alpine AS builder
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
ENV CGO_ENABLED=0
|
||||
ENV GO111MODULE=on
|
||||
ENV GOFLAGS="-trimpath -ldflags=-linkmode=external"
|
||||
|
||||
RUN apk add --no-cache git gcc musl-dev
|
||||
|
||||
COPY . /src/
|
||||
|
||||
RUN \
|
||||
go build -v -o /tmp/gmnhg ./cmd/gmnhg && \
|
||||
go build -v -o /tmp/md2gmn ./cmd/md2gmn
|
||||
|
||||
FROM alpine:3.12 AS runner
|
||||
|
||||
LABEL maintainer "Timur Demin <me@tdem.in>"
|
||||
|
||||
COPY --from=builder /tmp/gmnhg /tmp/md2gmn /bin/
|
||||
|
||||
CMD ["/bin/sh"]
|
Loading…
Reference in a new issue