From 7830955b4fd1365e6df907fc0c20f80a853c6b77 Mon Sep 17 00:00:00 2001 From: Tyler Date: Wed, 30 Mar 2022 20:13:51 -0400 Subject: [PATCH] Disable cgo, add docker support --- .drone.yml | 10 ++++++++++ Dockerfile | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml index 73f9fd4..748b315 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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: {} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a5995af --- /dev/null +++ b/Dockerfile @@ -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 \ No newline at end of file