docker: Create "/.dockerenv" if it doesn't exist.

When building through the CI builders, detection of the Docker environment
doesn't work. So we always create the file manually to make sure the version
contains "~docker" in this case.
This commit is contained in:
Joachim Bauch 2023-11-15 12:03:43 +01:00
parent 4b019a991f
commit 838e601183
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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