Skip to content

Instantly share code, notes, and snippets.

@flooose
Last active December 31, 2016 17:01
Show Gist options
  • Select an option

  • Save flooose/1bcc27ec27c3a05f85ce61d872cf932c to your computer and use it in GitHub Desktop.

Select an option

Save flooose/1bcc27ec27c3a05f85ce61d872cf932c to your computer and use it in GitHub Desktop.
Containerizing applications on arch linux

This is how I containerize applications. I used this site for help and inspiration.

$ sudo pacstrap -i -c -d ~/chromium base chromium  --ignore linux

$ sudo systemd-nspawn -u root -D ~/chromium/ bash

root # useradd chris -m
root # su -l chris && cd
$ mkdir  -p mnt/pulse mnt/gdm
$ ^d
root # passwd chris

$ sudo systemd-nspawn -D ~/Containers/chromium/ \
--bind-ro /run/user/1000/gdm/:/home/chris/mnt/gdm \
--setenv=PULSE_SERVER=unix:/home/chris/mnt/pulse/native \
--setenv XAUTHORITY=/home/chris/mnt/gdm/Xauthority \
--setenv DISPLAY=$DISPLAY \
--bind /dev/snd/ \
--bind /run/user/1000/pulse/:/home/chris/mnt/pulse \
--bind /tmp/.X11-unix/ \
--bind /dev/shm \
--bind /etc/machine-id -u chris chromium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment