Disable cgo, add docker support
continuous-integration/drone/push Build is failing Details

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: commands:
- mkdir -p /build - mkdir -p /build
- go mod download - go mod download
- export CGO_ENABLED=0
- goc -o /build/dlrouter - goc -o /build/dlrouter
environment: environment:
GOOS: linux,windows,darwin GOOS: linux,windows,darwin
@ -36,6 +37,15 @@ steps:
from_secret: gitea_token from_secret: gitea_token
when: when:
event: tag 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: volumes:
- name: build - name: build
temp: {} 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