A plain docker build . of a clone now stamps the tag or short commit into mfer version and mfer --version, which showed only 0.1.0 before.
.dockerignore is the canonical copy plus this repo's *.tmp and *.dockerimage: it sends .git but not .git/config, which can hold a credential and which git describe does not need.
The build stage stamps main.Gitrev from the VERSION build argument when one is given, otherwise from git describe --tags --always, and fails if .git is present and no version comes out. git there trusts /src whoever owns it: a context sent as a tar archive, as upaas sends it, keeps its files' owners.
script/docker is the canonical copy, which passes VERSION (with --dirty) and builds with --no-cache.
bin/gitrev.sh, which the Makefile stamps with, passes --tags too.
Things the diff does not show:
The value goes into main.Gitrev: mfer version prints the mfer.Version constant, then the revision. Nothing reads main.Version.
The image's binary cannot run, already so on next: it is dynamically linked and the final stage is scratch. Read its version by copying it out of the image. Not fixed here.
script/cibuild passes no VERSION, so CI stamps what the build derives.
The Makefile's .dockerimage target passes a GITREV build argument the Dockerfile never declared; left as is.
Disclosure: no test added; the defect is in the Docker build, not in Go code.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/mfer/issues/112.
A plain `docker build .` of a clone now stamps the tag or short commit into `mfer version` and `mfer --version`, which showed only `0.1.0` before.
- `.dockerignore` is the canonical copy plus this repo's `*.tmp` and `*.dockerimage`: it sends `.git` but not `.git/config`, which can hold a credential and which `git describe` does not need.
- The build stage stamps `main.Gitrev` from the `VERSION` build argument when one is given, otherwise from `git describe --tags --always`, and fails if `.git` is present and no version comes out. git there trusts `/src` whoever owns it: a context sent as a tar archive, as upaas sends it, keeps its files' owners.
- `script/docker` is the canonical copy, which passes `VERSION` (with `--dirty`) and builds with `--no-cache`.
- `bin/gitrev.sh`, which the Makefile stamps with, passes `--tags` too.
Things the diff does not show:
- The value goes into `main.Gitrev`: `mfer version` prints the `mfer.Version` constant, then the revision. Nothing reads `main.Version`.
- The image's binary cannot run, already so on `next`: it is dynamically linked and the final stage is `scratch`. Read its version by copying it out of the image. Not fixed here.
- `script/cibuild` passes no `VERSION`, so CI stamps what the build derives.
- The Makefile's `.dockerimage` target passes a `GITREV` build argument the `Dockerfile` never declared; left as is.
Disclosure: no test added; the defect is in the Docker build, not in Go code.
Model: opus-5-5
.dockerignore now sends .git but not .git/config, which can hold a
credential and which git describe does not need. The build stage stamps
main.Gitrev from the VERSION build argument when one is given, otherwise
from git describe --tags --always, and fails if .git is present and no
version comes out. git there trusts /src whoever owns it, since a
context sent as a tar archive keeps its files' owners. script/docker is
replaced by the canonical copy, which passes VERSION; bin/gitrev.sh uses
--tags too, so every entrypoint stamps the same value for a clean
commit.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #112.
A plain
docker build .of a clone now stamps the tag or short commit intomfer versionandmfer --version, which showed only0.1.0before..dockerignoreis the canonical copy plus this repo's*.tmpand*.dockerimage: it sends.gitbut not.git/config, which can hold a credential and whichgit describedoes not need.main.Gitrevfrom theVERSIONbuild argument when one is given, otherwise fromgit describe --tags --always, and fails if.gitis present and no version comes out. git there trusts/srcwhoever owns it: a context sent as a tar archive, as upaas sends it, keeps its files' owners.script/dockeris the canonical copy, which passesVERSION(with--dirty) and builds with--no-cache.bin/gitrev.sh, which the Makefile stamps with, passes--tagstoo.Things the diff does not show:
main.Gitrev:mfer versionprints themfer.Versionconstant, then the revision. Nothing readsmain.Version.next: it is dynamically linked and the final stage isscratch. Read its version by copying it out of the image. Not fixed here.script/cibuildpasses noVERSION, so CI stamps what the build derives..dockerimagetarget passes aGITREVbuild argument theDockerfilenever declared; left as is.Disclosure: no test added; the defect is in the Docker build, not in Go code.
Model: opus-5-5
Review passed.
Model: opus-5-5