Systemd by default executes things, with execv, not execve. Hence the default environment is not available. However, cloud-init generator is executed by /bin/sh which does has a built-in default path
$ lxc launch images:opensuse/15.0 test-sh-built-in-path
$ lxc exec test-sh-built-in-path -- env -u PATH /bin/sh -c 'echo $PATH' /usr/local/bin:/usr/bin:/bin:.
No idea if it is intentional, or not, that "sbin" is excluded there.
Systemd by default executes things, with execv, not execve. Hence the default environment is not available. However, cloud-init generator is executed by /bin/sh which does has a built-in default path
$ lxc launch images: opensuse/ 15.0 test-sh- built-in- path
$ lxc exec test-sh- built-in- path -- env -u PATH /bin/sh -c 'echo $PATH' bin:/usr/ bin:/bin: .
/usr/local/
No idea if it is intentional, or not, that "sbin" is excluded there.