mirror of
https://github.com/Snawoot/hola-proxy.git
synced 2026-04-02 17:18:13 +00:00
embed version into docker image
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
FROM golang AS build
|
||||
|
||||
ARG GIT_DESC=undefined
|
||||
|
||||
WORKDIR /go/src/github.com/Snawoot/hola-proxy
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-s -w -extldflags "-static"'
|
||||
RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-s -w -extldflags "-static" -X main.version=$GIT_DESC'
|
||||
ADD https://curl.haxx.se/ca/cacert.pem /certs.crt
|
||||
RUN chmod 0644 /certs.crt
|
||||
|
||||
|
||||
2
hooks/build
Normal file
2
hooks/build
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
docker build --build-arg GIT_DESC="$(git describe)" -f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" .
|
||||
Reference in New Issue
Block a user