1
0
mirror of https://github.com/containers/buildah.git synced 2025-07-30 04:23:09 +03:00

--iidfile: print hash prefix

Prefix the image ID with the hash prefix when using `--iidfile` to be
compatible with Docker.  The absence of the hash can cause
docker-compose to error out.

Reported-in: github.com/containers/podman/issues/9260
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2021-02-08 11:59:39 +01:00
parent 520c781522
commit 2301d148da
4 changed files with 4 additions and 2 deletions

View File

@ -466,7 +466,7 @@ func (b *Builder) Commit(ctx context.Context, dest types.ImageReference, options
dest = dest2
}
if options.IIDFile != "" {
if err = ioutil.WriteFile(options.IIDFile, []byte(img.ID), 0644); err != nil {
if err = ioutil.WriteFile(options.IIDFile, []byte("sha256:"+img.ID), 0644); err != nil {
return imgID, nil, "", err
}
}