Running a quick Linux container
I wanted to have a one-shot command to boot up and log in to a Linux container on my Mac. After some trial and error, the command is:
docker run -it --rm ubuntu
Maybe there are even quicker ways to do it, but that is pretty instant. I needed this today because I ran across a bot network on GitHub which was trying to get people to install a malicious .exe file. I wanted to poke around with the payload but limit the blast radius.
Note that Docker is not a great security sandbox, but it's better than nothing. And poking around with a Windows payload in a Linux container on a macOS host is probably safe-ish.
Thanks Justin for telling me about the --rm option that gets rid of the machine after you're done!