From 8cd99fe94a9c4f2f148d00cd2f1535e534b333e8 Mon Sep 17 00:00:00 2001 From: Zhao Xiaojie Date: Sun, 27 Jan 2019 22:10:40 +0800 Subject: [PATCH] fixes can not execute --- Dockerfile | 5 ++--- Makefile | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0f696d7..46ce44b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,8 @@ FROM alpine:3.3 USER root -RUN apk -U upgrade && \ - apk -U add --no-cache ca-certificates && \ - update-ca-certificates +RUN sed -i 's|dl-cdn.alpinelinux.org|mirrors.aliyun.com|g' /etc/apk/repositories +RUN apk add --no-cache ca-certificates curl COPY bin/wechat-backend wechat-backend diff --git a/Makefile b/Makefile index 24d0f09..5852550 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,9 @@ build: - env GOOS=linux go build -o bin/wechat-backend + CGO_ENABLED=0 GOOS=linux go build -ldflags "-w -s" -a -installsuffix cgo -o bin/wechat-backend + upx bin/wechat-backend + +build-local: + env go build -o bin/wechat-backend upx bin/wechat-backend image: build -- GitLab