Skip to content

Instantly share code, notes, and snippets.

@nottrobin
Last active February 6, 2019 23:00
Show Gist options
  • Select an option

  • Save nottrobin/4c6f14abbcb5031946730cb1fbb4eb53 to your computer and use it in GitHub Desktop.

Select an option

Save nottrobin/4c6f14abbcb5031946730cb1fbb4eb53 to your computer and use it in GitHub Desktop.
# Get the codebase
git clone git+ssh://{username}@git.launchpad.net/crbs
# Start a new LXC container
lxc launch ubuntu:bionic crbs
# Share the local repository folder with the container (at ~/crbs)
setfacl -Rm user:lxd:rwx,default:user:lxd:rwx,user:165536:rwx,default:user:165536:rwx,user:166536:rwx,default:user:166536:rwx . # Add permissions for the LXD users
lxc config device add crbs crbs-repo disk source=`pwd` path=/home/ubuntu/crbs # Share the folder as a LXD device
# SSH into the container
cat ~/.ssh/id_rsa.pub | lxc exec crbs -- sudo tee -a /home/ubuntu/.ssh/authorized_keys # Add your SSH key (assuming your public key is id_rsa.pub)
IP_ADDRESS=$(lxc list crbs --format=json | jq -r '.[0]["state"]["network"]["eth0"]["addresses"][0]["address"]') # Grab the IP address
ssh -o StrictHostKeyChecking=no ubuntu@${IP_ADDRESS} # SSH into the box
cd crbs # Get into the repository
# Install Make
sudo apt update
sudo apt install -y build-essential
# Install project dependencies
make dep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment