summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-06-28 12:17:20 +0200
committerLibravatar GitHub <noreply@github.com>2021-06-28 12:17:20 +0200
commit4f3b3f5c0b00b8c47c7e7d8e6c2dda624e114cde (patch)
treeaf7583b906543148fcd00c2e4e3bf0525f03be18 /Dockerfile
parentRemote instance dereferencing (#70) (diff)
downloadgotosocial-4f3b3f5c0b00b8c47c7e7d8e6c2dda624e114cde.tar.xz
put version in binary properly (#73)
Addresses #71 : Set version on the CLI framework. Add a build.sh script that injects variables into the build tooling using git and a version file. Set version in config.
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile11
1 files changed, 10 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile
index 4fa961e5e..fe94ef5a5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,6 @@
FROM golang:1.16.4-alpine3.13 AS builder
+RUN apk update && apk upgrade --no-cache
+RUN apk add git
# create build dir
RUN mkdir -p /go/src/github.com/superseriousbusiness/gotosocial
@@ -11,8 +13,15 @@ ADD testrig /go/src/github.com/superseriousbusiness/gotosocial/testrig
ADD go.mod /go/src/github.com/superseriousbusiness/gotosocial/go.mod
ADD go.sum /go/src/github.com/superseriousbusiness/gotosocial/go.sum
+# move .git dir and version for versioning
+ADD .git /go/src/github.com/superseriousbusiness/gotosocial/.git
+ADD version /go/src/github.com/superseriousbusiness/gotosocial/version
+
+# move the build script
+ADD build.sh /go/src/github.com/superseriousbusiness/gotosocial/build.sh
+
# do the build step
-RUN go build ./cmd/gotosocial
+RUN ./build.sh
FROM alpine:3.13 AS executor
RUN apk update && apk upgrade --no-cache