-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IID not written when using docker CLI #24644
Comments
What do you think should be default behaviour?
If this is real docker not writing to the file, then it seems like a Docker bug? |
docker is writing nothing to the file when using podman engine, but writes the image ID when using docker engine. Looks like something in the API that podman exposes to docker. |
Ok do docker->Podman.sock, ends up with nothing in the file, which means we are somehow not responding the way docker expects. |
That's probably it. I need to debug a bit more to figure out what exactly is missing or out of place. |
I built this simple C# program: using Docker.DotNet;
using Docker.DotNet.Models;
using System.Formats.Tar;
using var contents = new MemoryStream();
using (var tarWriter = new TarWriter(contents, TarEntryFormat.Pax, true))
{
using var dockerfile = new MemoryStream();
dockerfile.Write(
"""
FROM alpine:latest
RUN echo 'x' > x.txt
"""u8);
dockerfile.Seek(0, SeekOrigin.Begin);
var tarEntry = new PaxTarEntry(TarEntryType.RegularFile, "Dockerfile");
tarEntry.DataStream = dockerfile;
await tarWriter.WriteEntryAsync(tarEntry);
}
contents.Seek(0, SeekOrigin.Begin);
using var configuration = new DockerClientConfiguration();
var client = configuration.CreateClient();
var imageBuildParameters = new ImageBuildParameters
{
Dockerfile = "Dockerfile",
Tags = ["test"],
};
await client.Images.BuildImageFromDockerfileAsync(
imageBuildParameters,
contents,
[],
new Dictionary<string, string>(),
new Progress<JSONMessage>(value =>
{
if (!string.IsNullOrEmpty(value.Stream))
{
Console.WriteLine($"Stream: {value.Stream}");
}
if (!string.IsNullOrEmpty(value.Status))
{
Console.WriteLine($"Status: {value.Status}");
}
if (value.Error is { } error)
{
Console.WriteLine($"Error {error.Code}: {error.Message}");
throw new Exception(error.Message);
}
if (!string.IsNullOrEmpty(value.ProgressMessage))
{
Console.WriteLine($"Progress: {value.ProgressMessage}");
}
if (!string.IsNullOrEmpty(value.ID))
{
Console.WriteLine($"ID: {value.ID}");
}
})); And got this output from Rancher Desktop engine:
And this from Podman engine:
So, not much difference here. But using this docker CLI:
the iid file ends up empty. The file is created with 0 bytes. |
I think we need to examine the difference between the API when talking to the docker daemon versus talking to the podman service. |
I've looked a bit more into it, and it looks like an issue with https://github.com/docker/buildx. I've opened docker/buildx#2820 |
Issue Description
docker build --iidfile <path to iidfile> ...
produces an empty file whilepodman build --iidfile <path to iidfile> ...
produces a file with the image ID.Steps to reproduce the issue
Steps to reproduce the issue
docker build --iidfile iid.txt -f Dockerfile .
iid.txt
file is emptypodman build --iidfile iid.txt -f Dockerfile .
iid.txt
file has the image IDDescribe the results you received
No image ID written to the iidfile when using docker CLI.
Describe the results you expected
Image ID written to the iidfile when using docker CLI.
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Windows 11
Additional information
No response
The text was updated successfully, but these errors were encountered: