0

When I run buildah, I typically use a heredoc,

ctr=$(buildah from alpine:3);

buildah run $ctr sh -- <<EOF
  apk update;
  apk add git;
EOF

buildah commit $ctr heredoc_demo;

However, when I try to do the same thing with podman, I get an error like this,

WARN[0000] The input device is not a TTY. The --tty and --interactive flags might not work properly

Which you can get with,

❯ podman run -ti alpine:3 sh -- <<EOF
  echo 42
EOF
WARN[0000] The input device is not a TTY. The `--tty` and `--interactive` flags might not work properly

Or nothing happens as with

podman run alpine:3 sh <<EOF

What is the right invocation here?

0

1 Answer 1

1

You have two options, note:

  • do not use -t (--tty)
  • do use an -i (--interactive)

This looks like this,

podman run -i heredoc_demo sh -- <<EOF
    echo "Hello world";
EOF

Or,

cat <<EOF | podman run -i heredoc_demo sh -
    echo "Hello world";
EOF

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.