From 2f7abad804060737b3e3e060e9b13802d2964c53 Mon Sep 17 00:00:00 2001 From: boypt <1033514+boypt@users.noreply.github.com> Date: Wed, 4 Dec 2019 00:32:16 +0800 Subject: [PATCH] dockerfile update --- Dockerfile | 8 +++++++- static/generate.sh | 14 ++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1839653d4..8d71ad28e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,13 @@ FROM golang:alpine AS builder RUN apk update && apk add --no-cache git WORKDIR /root/cloud-torrent -RUN git clone https://github.com/boypt/cloud-torrent.git . +ENV PATH=$HOME/go/bin:$PATH +RUN git clone https://github.com/boypt/cloud-torrent.git . && \ + go get -v -u github.com/shuLhan/go-bindata/... && \ + go get -v -t -d ./... && \ + cd static && \ + sh generate.sh + ENV GO111MODULE=on CGO_ENABLED=0 RUN go build -ldflags "-s -w -X main.VERSION=$(git describe --tags)" -o /usr/local/bin/cloud-torrent ############################ diff --git a/static/generate.sh b/static/generate.sh index d5ec07811..07137d1f9 100755 --- a/static/generate.sh +++ b/static/generate.sh @@ -1,12 +1,10 @@ -#!/bin/bash -__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -cd ${__dir} +#!/bin/sh GITVER=$(git describe --tags) sed -i "s/CLDVER/${GITVER}/g" \ - ${__dir}/files/index.html \ - ${__dir}/files/sub/magadded.html \ - ${__dir}/files/template/downloads.html \ - ${__dir}/files/css/app.css + files/index.html \ + files/sub/magadded.html \ + files/template/downloads.html \ + files/css/app.css go generate -git checkout -- ${__dir}/files +git checkout -- files