How to create a file with context from stdin into a LXD/Incus container?

Hi!

How to create a file with context from stdin into a LXD/Incus container?

I tried push or create but got fail:

cat << EOF | incus file push websurf/var/lib/cloud/scripts/per-once/001_wayland
#cloud-config
runcmd:
  - echo WAYLAND_DISPLAY="$WAYLAND_DISPLAY" >> /etc/environment
EOF

Thanks for all. I understood how it works (anonymous parameter - dash):

cat << EOF | incus file push - websurf/var/lib/cloud/scripts/per-once/001_wayland
#cloud-config
runcmd:
  - echo WAYLAND_DISPLAY="$WAYLAND_DISPLAY" >> /etc/environment
EOF
3 Likes