Skip to content

Self-build but can not show the correct version #1182

@vndroid

Description

@vndroid

Describe the bug
I clone the repo, and build it myself, but it can not show the program version info.

To reproduce
Steps to reproduce the behavior:

git clone https://github.com/nginx/nginx-prometheus-exporter.git
cd nginx-prometheus-exporter/
make container

Run it and returns:

docker container run --rm -it docker.io/nginx/nginx-prometheus-exporter:1.5.1  --version
nginx_exporter, version  (branch: , revision: unknown)
  build user:       
  build date:       
  go version:       go1.25.2
  platform:         linux/amd64
  tags:             unknown

The version, branch, user, and date info are blank.

Expected behavior

I use ghcr.io official image, which can return the correct info. Are there any mistakes in my operation steps?

Your environment

  • Docker 28.5.1

Additional context

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    communityIssues or PRs opened by an external contributor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions