github nspawn/nspawn 3.4.0
nspawn 3.4.0

one hour ago

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 without tty and
    a Docker API container without Tty, so a program that looks for a terminal found
    /dev/pts/0 and wrote colours and progress bars into its log. Without -t it has no
    terminal and no /dev/console, and its output and errors reach the log through pipes.
    A program that opens /dev/stdout or /dev/stderr to log, as nginx does, writes
    there too: nspawn attach-relay copies 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's sh, ends at once under run -d. With -i, stdin_open or
    OpenStdin the 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 by nspawn 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 up makes a machine anew when its terminal or open input is not the one its
    service asks for, and generate prints -i and -t.

Added

  • run -d -i and run -d -t, which were refused: an input that stays open, and a
    terminal whose output goes into the machine's log.
  • create -i and create -t, the same for a machine made without a run.
  • The bus: StartMachine takes tty and interactive, and CreateMachine and
    RunMachine keep them in the machine's record, where GetMachine shows them.

Fixed

  • hub ls failed as a whole, with listing 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 their Tty and OpenStdin: a machine
    made with run -it or run -i, or one whose shell run -d kept waiting, gets no
    terminal and an empty input until it is made again with run -d -it or
    create -it. A compose service with tty or stdin_open is 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, so logs and the Docker API's logs show both as output.
  • A terminal on a start without a run reads TERM=dumb. An attached run -t
    passes the caller's TERM.
  • The Docker API refuses an attach with the input to a running container with 501,
    even one made with OpenStdin; an attach without the input follows the output.
  • Limits are not visible inside a machine. -m, --cpus and --pids-limit bound
    the machine's unit, while its program runs in a cgroup below it, where
    /sys/fs/cgroup/memory.max, memory.swap.max, cpu.max and pids.max read max.
    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-size or -Xmx. docs/USAGE.md says more.

Requirements

As for 3.0.0.

Don't miss a new nspawn release

NewReleases is sending notifications on new releases.