Skip to content

Instantly share code, notes, and snippets.

@pierew
Last active October 17, 2018 19:20
Show Gist options
  • Save pierew/3e3037142938028aeccbe2390a376397 to your computer and use it in GitHub Desktop.
Save pierew/3e3037142938028aeccbe2390a376397 to your computer and use it in GitHub Desktop.
Docker in Docker Isolation for cheap
if [[ $(docker inspect -f {{.State.Running}} $USER 2>/dev/null) ]]; then
docker exec -it $USER /bin/sh
else
echo "Initializing your Docker Environment..."
docker run --name $USER --privileged -d docker:dind
sleep 1
docker exec -it $USER /bin/sh
fi
#!/bin/bash
sudo /usr/local/bin/dockerconnect
Defaults env_keep += "USER"
%users ALL=(ALL) NOPASSWD:ALL /usr/local/bin/dockerconnect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment