Created
September 16, 2021 12:16
-
-
Save metaskills/f57fe57b87b8e60c4f4210391f370ebd to your computer and use it in GitHub Desktop.
Custom Ink Common Strap Codespaces Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dockerFile": "Dockerfile", | |
"runArgs": ["--init", "--privileged"], | |
"mounts": ["source=dind-var-lib-docker,target=/var/lib/docker,type=volume"], | |
"remoteUser": "root", | |
"postCreateCommand": "./.devcontainer/postCreate", | |
"postAttachCommand": "./.devcontainer/postAttach" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:14 | |
VOLUME [ "/var/lib/docker" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
rm -rf /workspaces/.strap-codespaces | |
git clone "https://${GITHUB_TOKEN}@github.com/myorg/strap-codespaces.git" /workspaces/.strap-codespaces | |
cd /workspaces/.strap-codespaces | |
./postCreate.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
if ! [ -x "$(command -v docker)" ]; then | |
echo "== [Custom Ink Strap Codespaces] installing 'docker' and 'docker-compose'... ==" | |
URL="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/docker-in-docker-debian.sh" | |
curl -s $URL | sudo bash /dev/stdin 1> /dev/null | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
echo "== [Custom Ink Strap Codespaces] installing 'ssh-agent' script... ==" | |
AGENT_SCRIPT=$(cat ./create-ssh-agent-script) | |
echo "$AGENT_SCRIPT" >> $HOME/.zshrc | |
echo "$AGENT_SCRIPT" >> $HOME/.bashrc | |
echo "== [Custom Ink Strap Codespaces] installing 'ssh-add' script... ==" | |
ADD_SCRIPT=$(cat ./create-ssh-add-script) | |
echo "$ADD_SCRIPT" >> $HOME/.zshrc | |
echo "$ADD_SCRIPT" >> $HOME/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
echo "== [Custom Ink Strap Codespaces] (postAttach)... ==" | |
# Docker | |
./start-docker.sh | |
echo "== [Custom Ink Strap Codespaces] (postAttach) complete! ==" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
echo "== [Custom Ink Strap Codespaces] (postCreate) ... ==" | |
# AWS | |
./create-aws-cli.sh | |
./create-aws-credentials.sh | |
# Docker | |
./create-docker.sh | |
# SSH | |
./create-ssh-known-hosts.sh | |
./create-ssh-starters.sh | |
echo "== [Custom Ink Strap Codespaces] (postCreate) complete! ==" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
echo "== [Custom Ink Strap Codespaces] starting docker daemon if not already... ==" | |
if [ -f "/usr/local/share/docker-init.sh" ]; then | |
if ! pgrep -f dockerd > /dev/null 2>&1; then | |
nohup bash -c "/usr/local/share/docker-init.sh &" </dev/null >/dev/null 2>&1 | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment