Skip to content

Instantly share code, notes, and snippets.

@mitchwongho
Last active June 26, 2024 07:28
Show Gist options
  • Save mitchwongho/11266726 to your computer and use it in GitHub Desktop.
Save mitchwongho/11266726 to your computer and use it in GitHub Desktop.
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@pere000
Copy link

pere000 commented Feb 1, 2022

sudo docker run -it --entrypoint /bin/bash node:latest #Thanks to @jghaines
...........9e0d1dcbc703 node:latest "/bin/bash" 12 minutes ago Up 12 minutes trusting_yonath #Thanks to Solomon Hykes
sudo docker trusting_yonath bash -c "echo 'Hello World, again!' >> file.txt" #Thanks to Stackoverflow
...........bin boot dev etc file.txt home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var #Thanks to Stallman&Torvalds

Thanks to Github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment