Skip to content

Instantly share code, notes, and snippets.

@Neoglyph
Created February 26, 2018 08:25
Show Gist options
  • Save Neoglyph/6f64b0a1b95fd8ecb295efcab97ab4aa to your computer and use it in GitHub Desktop.
Save Neoglyph/6f64b0a1b95fd8ecb295efcab97ab4aa to your computer and use it in GitHub Desktop.
Docker getting inside a container or image
// Found on stackoverflow from: https://stackoverflow.com/users/5641227/khalil-gharbaoui
This command should let you explore a running docker container:
docker exec -it name-of-container bash
once inside do:
ls -lsa
or any other bash command like:
cd ..
This command should let you explore a docker image:
docker run --rm -it --entrypoint=/bin/bash name-of-image
once inside do:
ls -lsa
or any other bash command like:
cd ..
The -it stands for interactive... and tty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment