Skip to content

Instantly share code, notes, and snippets.

@dbirks
Created September 30, 2020 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbirks/4b0aea038c2619601fc844e40db7086e to your computer and use it in GitHub Desktop.
Save dbirks/4b0aea038c2619601fc844e40db7086e to your computer and use it in GitHub Desktop.
Clean build an Arch Linux package inside a container
#!/bin/sh
set -o errexit
trap "docker rm --force lens-build" EXIT
docker pull archlinux
docker run \
--detach \
--name lens-build \
archlinux \
sleep infinity
docker exec -i lens-build bash <<-EOF
set -o verbose
pacman -Sy --noconfirm \
base-devel \
git \
nodejs-lts-erbium \
node-gyp \
yarn
useradd --create-home testuser
echo "testuser ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/testuser
su - testuser
git clone https://aur.archlinux.org/lens.git
cd lens
makepkg -si --noconfirm
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment