Hi,
I am running LXD version 4.8 on Ubuntu 16.04.
The following command crashes with an out-of-memory error:
yes | lxc launch ubuntu:18.04 my-container
Apparently, lxc
tries to read from stdin
and assumes
that what it reads is finite.
Here is some background and the use-case in which this
error (or feature?) occurs:
I have a script called exec-in-container.sh
. This script
shall create a container, if it not already exists, and
execute a command in it. In pseudo-code:
if container does not exist then
lxc launch ubuntu:18.04 my-container
fi
lxc exec my-container -- some-command
If I need to run an interactive script inside the container,
occasionally I would like to automate it using the yes
command:
yes | exec-in-container.sh some-interactive-command
This worked with LXD-3.9 but now it’s broken
Any ideas?
Best,
Holger