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

image-mode-basics: Containerfile should use Heredoc format #516

Open
benblasco opened this issue Jul 19, 2024 · 4 comments
Open

image-mode-basics: Containerfile should use Heredoc format #516

benblasco opened this issue Jul 19, 2024 · 4 comments
Labels
blocked Can't move forward until something else happens first enhancement New feature or request

Comments

@benblasco
Copy link

As of Podman 4.9 we support the Heredoc format for containerfiles, so maybe it's worth moving to that. This means that the containerfile just has one RUN directive and therefore I believe it would reduce the number of layers, reducing the size of the container and the time it takes to build and transport.

image

Existing Containerfile

FROM registry.redhat.io/rhel9/rhel-bootc

ADD etc /etc

RUN dnf install -y httpd
RUN systemctl enable httpd

Proposed new Containerfile

FROM registry.redhat.io/rhel9/rhel-bootc

ADD etc /etc

RUN <<EOF
    dnf install -y httpd
    systemctl enable httpd
EOF
@benblasco
Copy link
Author

benblasco commented Jul 19, 2024

Hello @nzwulfin, thoughts?

More reading on Heredoc here:
https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/

@benblasco
Copy link
Author

Note: Later when I added vim to the Containerfile the podman build command seemed not to pick it up. Will investigate further to see if it is a product issue.

@nzwulfin
Copy link
Collaborator

Generally I'm on board with this, very happy to see the support land. I did some local testing yesterday on this, it seems to have a few quirks I haven't worked out consistently. I'm going to keep testing and see if I can get consistent successes with a heredoc that works. Until then, I'll watch this.

@nzwulfin nzwulfin added the enhancement New feature or request label Jul 19, 2024
@benblasco
Copy link
Author

Looks like there's a bug based on my testing, so we will have to park it for now. I created a JIRA issue we can follow:
https://issues.redhat.com/browse/RHEL-50145

@nzwulfin nzwulfin added the blocked Can't move forward until something else happens first label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Can't move forward until something else happens first enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants