diff --git a/docker/proxy/Dockerfile b/docker/proxy/Dockerfile index e308ee1..fb57261 100644 --- a/docker/proxy/Dockerfile +++ b/docker/proxy/Dockerfile @@ -5,7 +5,8 @@ ARG TARGETOS WORKDIR /workdir COPY . . -RUN apk add --no-cache bash git build-base protobuf && \ +RUN touch /.dockerenv && \ + apk add --no-cache bash git build-base protobuf && \ if [ -d "vendor" ]; then GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOPROXY=off make proxy; else \ GOOS=${TARGETOS} GOARCH=${TARGETARCH} make proxy; fi diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index 26addc7..401e769 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -5,7 +5,8 @@ ARG TARGETOS WORKDIR /workdir COPY . . -RUN apk add --no-cache bash git build-base protobuf && \ +RUN touch /.dockerenv && \ + apk add --no-cache bash git build-base protobuf && \ if [ -d "vendor" ]; then GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOPROXY=off make server; else \ GOOS=${TARGETOS} GOARCH=${TARGETARCH} make server; fi diff --git a/scripts/get-version.sh b/scripts/get-version.sh index 2f1e024..e1fc562 100755 --- a/scripts/get-version.sh +++ b/scripts/get-version.sh @@ -15,6 +15,11 @@ if [ -z "$VERSION" ] && [ -d "$ROOT/../.git" ]; then else VERSION=$(git log -1 --pretty=%H) fi + if [ -f "/.dockerenv" ]; then + VERSION="$VERSION~docker" + elif grep -sq 'docker\|lxc' /proc/1/cgroup; then + VERSION="$VERSION~docker" + fi fi if [ -z "$VERSION" ]; then