Skip to content

Instantly share code, notes, and snippets.

@Zate
Last active July 31, 2018 09:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zate/a6be5e5528f177b2e3e2e193b91e350c to your computer and use it in GitHub Desktop.
Save Zate/a6be5e5528f177b2e3e2e193b91e350c to your computer and use it in GitHub Desktop.
Writing a script out to automate containers in crostini
#!/bin/bash
run_container.sh --container_name test --user zate
sleep 3
lxc exec test -- sh -c "apt-get update && sleep 1 && apt-get upgrade -y && sleep 1 && apt-get install wget curl -y"
sleep 1
lxc exec test -- sudo -u zate bash -c 'cd ~ && pwd && curl https://gist.githubusercontent.com/Zate/b3c8e18cbb2bbac2976d79525d95f893/raw/acbe81fe161ec194ab9eb30f1bf17f1f79919a45/get_go.sh -o get_go.sh && chmod +x get_go.sh && ./get_go.sh'
sleep 1
lxc exec test -- sudo -u zate bash -c 'cd ~ && pwd && curl https://gist.githubusercontent.com/Zate/b3c8e18cbb2bbac2976d79525d95f893/raw/acbe81fe161ec194ab9eb30f1bf17f1f79919a45/get_vscode.sh -o get_vscode.sh && chmod +x get_vscode.sh && ./get_vscode.sh'
sleep 1
lxc exec test -- sudo su -l zate -c 'cd ~ && code-insiders .'
#!/bin/bash
cd /mnt/stateful/lxd_conf
curl https://gist.githubusercontent.com/Zate/a6be5e5528f177b2e3e2e193b91e350c/raw/1df734402ca5a1837cd2e0a32ebb932e0365af0f/container.sh -o container.sh -s
chmod +x container.sh
export PATH=$PATH:/`pwd`
container.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment