Disable cgo, add docker support
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Tyler 2022-03-30 20:13:51 -04:00
parent 516390b17d
commit 7830955b4f
2 changed files with 21 additions and 0 deletions

View File

@ -11,6 +11,7 @@ steps:
commands:
- mkdir -p /build
- go mod download
- export CGO_ENABLED=0
- goc -o /build/dlrouter
environment:
GOOS: linux,windows,darwin
@ -36,6 +37,15 @@ steps:
from_secret: gitea_token
when:
event: tag
- name: docker
image: plugins/docker
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: registry.meow.tf/tyler/armbian-router
registry: registry.meow.tf
volumes:
- name: build
temp: {}

11
Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM golang:alpine AS builder
ADD . /src
WORKDIR /src
RUN CGO_ENABLED=0 go build -o /src/dlrouter
FROM alpine
COPY --from=builder /src/dlrouter /usr/bin/dlrouter