Open tmatth opened 2 weeks ago
Hello Tristan, the versiongetter script was introduced to automatically fill the version string inside the server, by using tag data inside the .git folder, an approach used by many other software.
Source code tarballs are automatically generated during every release and they do not include the .git folder nor any other data that might allow to extract the current version. My intention is to drop support for build processes that start from these tarballs. Your approach can be changed into:
FROM golang:1.23.2-bullseye
RUN git clone --depth=1 -b v1.9.2 http://github.com/bluenviron/mediamtx
WORKDIR mediamtx
RUN go generate ./...
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -v -o /tmp/rtsp-simple-server
Let me know if you have a better solution.
Hello Tristan, the versiongetter script was introduced to automatically fill the version string inside the server, by using tag data inside the .git folder, an approach used by many other software.
Source code tarballs are automatically generated during every release and they do not include the .git folder nor any other data that might allow to extract the current version. My intention is to drop support for build processes that start from these tarballs. Your approach can be changed into:
FROM golang:1.23.2-bullseye RUN git clone --depth=1 -b v1.9.2 http://github.com/bluenviron/mediamtx WORKDIR mediamtx RUN go generate ./... RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -v -o /tmp/rtsp-simple-server
Thanks that works around the issue for me.
Let me know if you have a better solution.
I'd suggest generating/including a VERSION
file in release tarballs and just falling back to using git if its missing, this way you don't force a dependency on git for downstream users/packagers.
Which version are you using?
v1.9.2
Which operating system are you using?
Linux amd64 Docker
Describe how to replicate the issue
I'm assuming this is since #3409, but the build seems to be failing when run in a standard golang docker image.
To reproduce:
Server logs
No response
Network dump
No response