nspawn 3.4.0 gives the program of an app machine a terminal and an open input only
when it is asked to, by -t and -i, compose's tty and stdin_open or the Docker
API's Tty and OpenStdin, and keeps them for the machine's later starts. hub ls
leaves out a repository deleted while it lists.
Changed
- An app's program has a terminal only with
-t. Every app's program ran on the
pseudo terminal of systemd-nspawn's console, also a compose service withoutttyand
a Docker API container withoutTty, so a program that looks for a terminal found
/dev/pts/0and wrote colours and progress bars into its log. Without-tit has no
terminal and no/dev/console, and its output and errors reach the log through pipes.
A program that opens/dev/stdoutor/dev/stderrto log, as nginx does, writes
there too:nspawn attach-relaycopies that output into the journal. - An app's input is empty without
-i. A shell an image runs by default, such as
busybox's or alpine'ssh, ends at once underrun -d. With-i,stdin_openor
OpenStdinthe input stays open and holds nothing, and the shell waits. - A machine keeps its terminal and its open input for the starts that follow: a
start bynspawn start,machinectl start, a restart policy or the boot gives the
program what its run,create, compose service or Docker API container asked for.
compose upmakes a machine anew when its terminal or open input is not the one its
service asks for, andgenerateprints-iand-t.
Added
run -d -iandrun -d -t, which were refused: an input that stays open, and a
terminal whose output goes into the machine's log.create -iandcreate -t, the same for a machine made without a run.- The bus:
StartMachinetakesttyandinteractive, andCreateMachineand
RunMachinekeep them in the machine's record, whereGetMachineshows them.
Fixed
hub lsfailed as a whole, withlisting tags of REPOSITORY, when a repository
was deleted between the registry's catalog and the query of its tags. It leaves that
repository out; a refusal, such as one for credentials, still ends the listing.
Upgrading
- A machine made by an earlier release follows these rules from its next start. Only
the Docker API's containers have a record of theirTtyandOpenStdin: a machine
made withrun -itorrun -i, or one whose shellrun -dkept waiting, gets no
terminal and an empty input until it is made again withrun -d -itor
create -it. A compose service withttyorstdin_openis made anew by the next
compose up. - On Fedora, nspawn-selinux brings the policy module 2.3.0, which lets the service run
the relay.
Known gaps
- Errors go with the output. A program's standard error reaches the log as its
output does, sologsand the Docker API's logs show both as output. - A terminal on a start without a run reads
TERM=dumb. An attachedrun -t
passes the caller'sTERM. - The Docker API refuses an attach with the input to a running container with 501,
even one made withOpenStdin; an attach without the input follows the output. - Limits are not visible inside a machine.
-m,--cpusand--pids-limitbound
the machine's unit, while its program runs in a cgroup below it, where
/sys/fs/cgroup/memory.max,memory.swap.max,cpu.maxandpids.maxreadmax.
A program that sizes itself from those files, as Node.js and the JVM do, takes the
host's memory and CPUs and runs into the limit; give it its size, such as
--max-old-space-sizeor-Xmx. docs/USAGE.md says more.
Requirements
As for 3.0.0.