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

podman commit: does not create entrypoint? #586

Closed
edsantiago opened this issue Apr 3, 2018 · 15 comments
Closed

podman commit: does not create entrypoint? #586

edsantiago opened this issue Apr 3, 2018 · 15 comments
Assignees
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@edsantiago
Copy link
Member

# podman run --name foo fedora date
Tue Apr  3 15:05:07 UTC 2018
# podman commit --quiet foo myimg
# podman run myimg
No command specified on command line or as CMD or ENTRYPOINT in this image

Expected: date output.

podman-0.3.5-1.gitdb6bf9e.fc27.x86_64

@mheon
Copy link
Member

mheon commented Apr 3, 2018

Podman commit needs to be changed to accept an image config (entrypoint, CMD, etc). We can store the ones the container was created with on the podman side (they're probably in create config anyways) and feed them into commit.

@mheon
Copy link
Member

mheon commented Apr 3, 2018

This should probably happen as part of the commit overhaul to use Buildah code and actually commit diffs (instead of export-import) that is covered by #520

@TomSweeneyRedHat
Copy link
Member

Related to #520

baude added a commit to baude/podman that referenced this issue Apr 9, 2018
@edsantiago
Copy link
Member Author

When and where should I expect to see this fixed? I'm still seeing the same behavior. Setup:

podman-0.4.4.1524346805-gitcf1d884.fc27.x86_64
buildah-0.16-1524410543.gitd84f05a.fc27.x86_64

Curiously, if you s/fedora/rhel7/ in comment 0, podman silently does nothing and exits 0. (No error message).

@mheon
Copy link
Member

mheon commented Apr 23, 2018

The code has landed, so if it's not working, we have a new bug with the way we use buildah to commit.

@edsantiago
Copy link
Member Author

@TomSweeneyRedHat @baude can one of you perform the comment-0 test on what you believe should be a working system setup, and either reopen this issue or let me know what I've done wrong in my setup? TIA.

@rhatdan rhatdan reopened this Apr 24, 2018
@rhatdan
Copy link
Member

rhatdan commented Apr 24, 2018

Reopening issue to get confirmation of it working or not.

@mheon
Copy link
Member

mheon commented Apr 24, 2018

Confirmed locally. @TomSweeneyRedHat does Buildah not set image config from the base image? Or are we just calling into it wrong.

@TomSweeneyRedHat
Copy link
Member

@mheon, looks like it's setting it OK to me unless I messed up the below test.

Test Results:

# ctr=$(buildah from centos:7)
Getting image source signatures
Copying blob sha256:469cfcc7a4b3947a4fa549c68cf4f8570be53779725f0c19f3d33d1520b08db0
 69.78 MiB / 69.78 MiB [====================================================] 9s
Copying config sha256:e934aafc22064b7322c0250f1e32e5ce93b2d19b356f4537f5864bd102e8531f
 2.15 KiB / 2.15 KiB [======================================================] 0s
Writing manifest to image destination
Storing signatures

# buildah config --workingdir /tmp $ctr
# buildah config --entrypoint /bin/bash $ctr

# buildah commit $ctr test1
Getting image source signatures
Skipping fetch of repeat blob sha256:43e653f84b79ba52711b0f726ff5a7fd1162ae9df4be76ca1de8370b8bbf9bb0
Skipping fetch of repeat blob sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1
Copying config sha256:5f4b9284fd6a9a6655783b9a9e5ce434ed937484fcd2d00a6fc925543f7afed4
 1.22 KiB / 1.22 KiB [======================================================] 0s
Writing manifest to image destination
Storing signatures
5f4b9284fd6a9a6655783b9a9e5ce434ed937484fcd2d00a6fc925543f7afed4

# buildah from test1
test1-working-container

# buildah run test1-working-container
[root@mrsdalloway tmp]# exit

# buildah inspect --format '{{.Docker.Config.Entrypoint}}' test1
[/bin/sh -c /bin/bash]

# buildah inspect --format '{{.Docker.Config.Entrypoint}}' test1-working-container
[/bin/sh -c /bin/bash]

@mheon
Copy link
Member

mheon commented Apr 24, 2018

@TomSweeneyRedHat Alright, so it's how we're calling into buildah to do a commit, then.

@mheon
Copy link
Member

mheon commented Apr 24, 2018

@baude PTAL

@jwhonce jwhonce added the bug label Apr 25, 2018
@baude baude self-assigned this Apr 25, 2018
baude added a commit to baude/podman that referenced this issue Apr 27, 2018
Vendor in buildah and use as much of commit and bug as possible for podman
build and commit.

Resolves containers#586
Signed-off-by: baude <[email protected]>
@edsantiago
Copy link
Member Author

Has anyone tried the three steps in my first comment? Can you get them to work? What am I doing wrong?

# podman run --name foo fedora date
Wed May 23 12:46:26 UTC 2018
# podman commit --quiet foo myimg
8183e7f0a0185b1f307bfa7e01e8623f48f7d319de0ac3d55e2702136b16d7bc
# podman run myimg
No command specified on command line or as CMD or ENTRYPOINT in this image

buildah-1.00-1526305410.gitce8d467.fc27.x86_64
podman-0.5.4-1527007540.git926d07d.fc27.x86_64

@rhatdan
Copy link
Member

rhatdan commented May 23, 2018

Do those commands work with Docker.
I think the issue is that you have not specified a CMD or Entrypoint,

# podman commit --change "CMD=date" --quiet foo myimg

Should do what you want. But if Docker automatically takes the CMD used to create the container then we have a bug.

@edsantiago
Copy link
Member Author

Oops - my bad, for not filing it as a docker-compat issue. Yes, docker uses the container's command as an entrypoint:

# docker run --name foo fedora date
Wed May 23 12:53:47 UTC 2018
# docker commit foo myimg
sha256:fd1fb7b03cd06c769b1eee0f14b659ed9fd5142c067a733e1e70658854ab7fe2
# docker run myimg
Wed May 23 12:54:08 UTC 2018

@rhatdan
Copy link
Member

rhatdan commented May 23, 2018

Ok I just looked at this in Docker and the problem is podman does not populating the CMD field on the podman run command. I will open a PR>

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

6 participants