Skip to content
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

Open
paulomorgado opened this issue Nov 21, 2024 · 1 comment
Open

IID not written when using docker CLI #24644

paulomorgado opened this issue Nov 21, 2024 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug. windows issue/bug on Windows

Comments

@paulomorgado
Copy link

Issue Description

docker build --iidfile <path to iidfile> ... produces an empty file while podman build --iidfile <path to iidfile> ... produces a file with the image ID.

Steps to reproduce the issue

Steps to reproduce the issue

  1. run docker build --iidfile iid.txt -f Dockerfile .
    1. the iid.txt file is empty
  2. run podman build --iidfile iid.txt -f Dockerfile .
    1. the iid.txt file has the image ID

Describe 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

PS> docker build -f .\Dockerfile --iidfile .\tmp\iid.txt .
[+] Building 2.5s (19/19) FINISHED                                                                                                              docker-container:default
 => [internal] load build definition from Dockerfile                                                                                                                0.1s
 => => transferring dockerfile: 2.23kB                                                                                                                              0.0s
 => resolve image config for docker-image://docker.io/docker/dockerfile:1.6                                                                                         1.3s
 => CACHED docker-image://docker.io/docker/dockerfile:1.6@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021                                   0.0s
 => => resolve docker.io/docker/dockerfile:1.6@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021                                              0.0s
 => [internal] load build definition from Dockerfile                                                                                                                0.0s
 => [internal] load metadata for docker.io/library/debian:12-slim                                                                                                   0.9s
 => [internal] load .dockerignore                                                                                                                                   0.0s
 => => transferring context: 2B                                                                                                                                     0.0s
 => [internal] preparing inline document                                                                                                                            0.0s
 => [internal] preparing inline document                                                                                                                            0.0s
 => [1/8] FROM docker.io/library/debian:12-slim@sha256:ca3372ce30b03a591ec573ea975ad8b0ecaf0eb17a354416741f8001bbcae33d                                             0.0s
 => => resolve docker.io/library/debian:12-slim@sha256:ca3372ce30b03a591ec573ea975ad8b0ecaf0eb17a354416741f8001bbcae33d                                             0.0s
 => [internal] load build context                                                                                                                                   0.0s
 => => transferring context: 80B                                                                                                                                    0.0s
 => [internal] preparing inline document                                                                                                                            0.0s
 => [internal] preparing inline document                                                                                                                            0.0s
 => CACHED [2/8] RUN <<'RUN_EOF' (#!/bin/bash...)                                                                                                                   0.0s
 => CACHED [3/8] RUN update-ca-certificates                                                                                                                         0.0s
 => CACHED [4/8] RUN <<'RUN_EOF' (#!/bin/bash...)                                                                                                                   0.0s
 => CACHED [5/8] RUN <<'RUN_EOF' (#!/bin/bash...)                                                                                                                   0.0s
 => CACHED [6/8] RUN <<'RUN_EOF' (#!/bin/bash...)                                                                                                                   0.0s
 => CACHED [7/8] COPY --chmod=755 terraform-outputs-to-tfvars.py /usr/local/bin/                                                                                    0.0s
 => CACHED [8/8] COPY --chmod=755 build.sh /usr/local/bin/                                                                                                          0.0s
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
PS> cat .\tmp\iid.txt
PS> podman build -f .\Dockerfile --iidfile .\tmp\iid.txt .
STEP 1/9: FROM debian:12-slim
STEP 2/9: RUN <<'RUN_EOF' (#!/bin/bash...)
--> Using cache be31f374d319e97eef9857dcbdd50f983c64ab7919a07f2504edbcac2b0780a6
--> be31f374d319
STEP 3/9: RUN update-ca-certificates
--> Using cache 5db90e28535565a3d10db7d79a0eebad716a478344a4a1abc4887b9325f46394
--> 5db90e285355
STEP 4/9: RUN <<'RUN_EOF' (#!/bin/bash...)
--> Using cache f5d8a88f2d1d5359d6f386f4e0029740a8bd9f5a0610df7f6ab4f38be70b5051
--> f5d8a88f2d1d
STEP 5/9: RUN <<'RUN_EOF' (#!/bin/bash...)
--> Using cache 1de49e144d06947e829031b7f507f319b5d5d86e4702fcdb6daaf40038264004
--> 1de49e144d06
STEP 6/9: RUN <<'RUN_EOF' (#!/bin/bash...)
--> Using cache 4c483af2f0a60a7c5ce204ad4e0943ef20da59b2a2b30c0126afbaae8bf60e0e
--> 4c483af2f0a6
STEP 7/9: COPY --chmod=755 terraform-outputs-to-tfvars.py /usr/local/bin/
--> Using cache 5ef146e6c468f81eba7a3197f1abcd9b843d3a2cf398c58a4ba953dda45d4ac7
--> 5ef146e6c468
STEP 8/9: COPY --chmod=755 build.sh /usr/local/bin/
--> Using cache 05daa8030e7caf42a6e7432dd3d3818e38547d2eb98fe792e6af167989513f2e
--> 05daa8030e7c
STEP 9/9: ENTRYPOINT ["build.sh"]
--> Using cache bcea3cd5427687ff2c6d90613ee7cd1a9cec645c7e8a0d77294e6c7ab35a56a0
--> bcea3cd54276bcea3cd5427687ff2c6d90613ee7cd1a9cec645c7e8a0d77294e6c7ab35a56a0
PS> cat .\tmp\iid.txt
sha256:bcea3cd5427687ff2c6d90613ee7cd1a9cec645c7e8a0d77294e6c7ab35a56a0

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

Windows 11

Client:       Podman Engine
Version:      5.3.0
API Version:  5.3.0
Go Version:   go1.23.3
Git Commit:   874bf2c301ecf0ba645f1bb45f81966cc755b7da
Built:        Wed Nov 13 13:19:59 2024
OS/Arch:      windows/amd64
 
Server:       Podman Engine
Version:      5.2.3
API Version:  5.2.3
Go Version:   go1.22.7
Built:        Tue Sep 24 01:00:00 2024
OS/Arch:      linux/amd64

Additional information

No response

@paulomorgado paulomorgado added the kind/bug Categorizes issue or PR as related to a bug. label Nov 21, 2024
@github-actions github-actions bot added the windows issue/bug on Windows label Nov 21, 2024
@rhatdan
Copy link
Member

rhatdan commented Nov 21, 2024

What do you think should be default behaviour?

$ podman build --help | grep iid
      --iidfile file                                 file to write the image ID to
$ docker build --help | grep iid
      --iidfile string                Write the image ID to a file

If this is real docker not writing to the file, then it seems like a Docker bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. windows issue/bug on Windows
Projects
None yet
Development

No branches or pull requests

2 participants