How do I get into a Docker container's shell? - Stack Overflow (https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196) (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (Stack Overflow) (/opensearch.xml) (https://stackoverflow.com/questions/30172605/how-do-i-get-into-a-docker-containers-shell) (https://cdn.sstatic.net/Shared/stacks.css?v=619122b796ae) (https://cdn.sstatic.net/Sites/stackoverflow/primary.css?v=02dcb5186b90) (Feed for question 'How do I get into a Docker container's shell?') (/feeds/question/30172605) (https://cdn.sstatic.net/Shared/Channels/channels.css?v=5981bb1a5bd7) (https://accounts.google.com/gsi/style) (site logo) Join Stack Overflow By clicking “Sign up”, you agree to our (/legal/terms-of-service/public) terms of service and acknowledge you have read our (/legal/privacy-policy) privacy policy . (e2a58aec89e0105273f31cf44dffd45d868462dc661de60a7d67e669a7370ceb) (1) (undefined) (2.0) Sign up with Google Sign up with GitHub OR (e2a58aec89e0105273f31cf44dffd45d868462dc661de60a7d67e669a7370ceb) (1) (undefined) Email Password (8+ characters (at least 1 letter & 1 number)) Sign up Already have an account? (/users/login) Log in (e2a58aec89e0105273f31cf44dffd45d868462dc661de60a7d67e669a7370ceb) () Skip to main content (https://stackoverflow.com) Stack Overflow (https://stackoverflow.co/) About Products (https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai) OverflowAI (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams) Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers (https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising) Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand (https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai) OverflowAI GenAI features for Teams (https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api) OverflowAPI Train & fine-tune LLMs (https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs) Labs The future of collective knowledge sharing (https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) About the company (https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog) Visit the blog (Search…) () Loading… (https://stackoverflow.com) current community (https://stackoverflow.com) (Stack Overflow) Stack Overflow (https://stackoverflow.com/help) help (https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com) chat (https://meta.stackoverflow.com) (Meta Stack Overflow) Meta Stack Overflow your communities (https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f30172605%2fhow-do-i-get-into-a-docker-containers-shell) Sign up or (https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f30172605%2fhow-do-i-get-into-a-docker-containers-shell) log in to customize your list. (https://stackexchange.com/sites) more stack exchange communities (https://stackoverflow.blog) company blog (Click to show search) (https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f30172605%2fhow-do-i-get-into-a-docker-containers-shell) Log in (https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f30172605%2fhow-do-i-get-into-a-docker-containers-shell) Sign up (/) Home (/questions) Questions (/tags) Tags (/users) Users (https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav) Companies Labs (/jobs?source=so-left-nav) Jobs (/beta/discussions) Discussions Collectives Communities for your favorite technologies. (/collectives-all) Explore all Collectives Teams Now available on Stack Overflow for Teams! AI features where you work: search, IDE, and chat. (https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=overflowai-learn-more) Learn more (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) Explore Teams Teams Ask questions, find answers and collaborate at work with Stack Overflow for Teams. (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact) Explore Teams Collectives™ on Stack Overflow Find centralized, trusted content and collaborate around the technologies you use most. (/collectives) Learn more about Collectives Teams Q&A for work Connect and share knowledge within a single location that is structured and easy to search. (https://stackoverflow.co/teams/) Learn more about Teams Get early access and see previews of new features. (https://stackoverflow.co/labs/) Learn more about Labs (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (/questions/30172605/how-do-i-get-into-a-docker-containers-shell) How do I get into a Docker container's shell? (/questions/ask) Ask Question (2015-05-11 16:12:30Z) Asked 9 years, 3 months ago Modified (?lastactivity) (2024-07-26 15:33:17Z) 1 month ago (Viewed 2,966,570 times) Viewed 3.0m times This question shows research effort; it is useful and clear (70:3:31e,16:7ca61daef5d31e39,10:1725240214,16:980f5da5196a19ef,8:30172605,91573758a4dbbbf850a75c9304bcb625285a2a28f8a4180449aa0cd8329efa65) 2300 (This question does not show any research effort; it is unclear or not useful) (70:3:31e,16:63861ec3173fe7f4,10:1725240214,16:bc0adb2f70b1c9d2,8:30172605,cb40463450d1d01c74f412b4b17b23af41246214001482220f1276153da45cf7) Save this question. (/posts/30172605/timeline) Show activity on this post. I'm getting started working with Docker. I'm using the WordPress base image and docker-compose . I'm trying to ssh into one of the containers to inspect the files/directories that were created during the initial build. I tried to run docker-compose run containername ls -la , but that didn't do anything. Even if it did, I'd rather have a console where I can traverse the directory structure, rather than run a single command. What is the right way to do this with Docker? (/questions/tagged/docker) (show questions tagged 'docker') docker (/questions/tagged/docker-container) (show questions tagged 'docker-container') docker-container (/q/30172605) (Short permalink to this question) Share Share a link to this question Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/30172605/edit) () Improve this question Follow (70:3:31e,16:7da9797292196318,10:1725240214,16:c32bfb344bcf5f84,8:30172605,8a4182de4aab48f55d132f7712cdfd162b8b7f1f34894f735ce62d6f57b80094) Follow this question to receive notifications (/posts/30172605/revisions) (show all edits to this post) edited (2024-02-14 21:35:27Z) Feb 14 at 21:35 (/users/3665178/manuel-jordan) (Manuel Jordan's user avatar) (/users/3665178/manuel-jordan) Manuel Jordan (reputation score 16,081) 16.1k (24 gold badges) 24 24 gold badges (102 silver badges) 102 102 silver badges (174 bronze badges) 174 174 bronze badges asked (2015-05-11 16:12:30Z) May 11, 2015 at 16:12 (/users/48523/andrew) (Andrew's user avatar) (/users/48523/andrew) Andrew Andrew (reputation score 236,161) 236k (195 gold badges) 195 195 gold badges (526 silver badges) 526 526 silver badges (713 bronze badges) 713 713 bronze badges 7 So it sounds like the answer is docker attach. But how can I get to that from docker-compose? – (/users/48523/andrew) (236,161 reputation) Andrew Commented (2015-05-11 16:27:27Z, License: CC BY-SA 3.0) May 11, 2015 at 16:27 (number of 'useful comment' votes received) 7 Use docker exec (http://askubuntu.com/a/543057/35816) askubuntu.com/a/543057/35816 . Get the container id using docker ps – (/users/21239/mauricio-scheffer) (99,480 reputation) Mauricio Scheffer Commented (2015-05-11 16:45:18Z, License: CC BY-SA 3.0) May 11, 2015 at 16:45 (number of 'useful comment' votes received) 64 sudo docker run -it --entrypoint /bin/bash gets you into the container interactively. Then one can inspect the file system in the container using cd – (/users/2500090/sergei) (270 reputation) Sergei Commented (2017-05-25 16:44:07Z, License: CC BY-SA 3.0) May 25, 2017 at 16:44 (this comment was edited 2 times) (number of 'useful comment' votes received) 8 @Sergei That's incorrect, docker run takes an image name, not a container ID. I was confused about running containers for a long time which is why I ended up writing (https://blog.andrewray.me/towards-a-strong-mental-model-of-docker/) blog.andrewray.me/towards-a-strong-mental-model-of-docker – (/users/743464/andy-ray) (31,657 reputation) Andy Ray Commented (2020-12-29 18:21:02Z, License: CC BY-SA 4.0) Dec 29, 2020 at 18:21 (number of 'useful comment' votes received) 1 @AndyRay (https://blog.andrewray.me/towards-a-strong-mental-model-of-docker/) blog.andrewray.me/towards-a-strong-mental-model-of-docker is a broken link, do you have a new link for it? – (/users/1340782/localhost) (1,253 reputation) localhost Commented (2022-11-10 23:17:20Z, License: CC BY-SA 4.0) Nov 10, 2022 at 23:17 (Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.) | (Expand to show all comments on this post) Show 2 more comments 33 Answers 33 Sorted by: (/questions/30172605/how-do-i-get-into-a-docker-containers-shell?answertab=scoredesc#tab-top) Reset to default (scoredesc) Highest score (default) (trending) Trending (recent votes count more) (modifieddesc) Date modified (newest first) (createdasc) Date created (oldest first) 1 (/questions/30172605/how-do-i-get-into-a-docker-containers-shell?page=2&tab=scoredesc#tab-top) (Go to page 2) 2 (/questions/30172605/how-do-i-get-into-a-docker-containers-shell?page=2&tab=scoredesc#tab-top) (Go to page 2) Next This answer is useful (70:3:31e,16:915747fc8749cd08,10:1725240214,16:e3b45e8160656a32,8:30173220,2e69ef806c482d9c07668bd55cc2fd1f7729da7c96bc8df8890f9bbb5a6e2314) 3122 (This answer is not useful) (70:3:31e,16:e7e63c4fbff77cf4,10:1725240214,16:4587f214feb54f69,8:30173220,2cc98f8b2ea87f70b7d559eb95659a33036d1306a63549a5c2e94ac60b496250) Save this answer. (Loading when this answer was accepted…) (/posts/30173220/timeline) Show activity on this post. docker attach will let you connect to your Docker container, but this isn't really the same thing as ssh . If your container is running a webserver, for example, docker attach will probably connect you to the stdout of the web server process. It won't necessarily give you a shell. The docker exec command is probably what you are looking for; this will let you run arbitrary commands inside an existing container. For example, to run bash inside a container: docker exec -it sh Of course, whatever command you are running must exist in the container filesystem; if your container doesn't have sh , this will fail with something like: OCI runtime exec failed: exec failed: unable to start container process: exec: "sh": executable file not found in $PATH: unknown [If your container doesn't have sh -- which is a common case for minimal images -- you may need to investigate other ways to explore the container filesystem.] In the above command is the name or ID of the target container. It doesn't matter whether or not you're using docker compose ; just run docker ps and use either the ID (a hexadecimal string displayed in the first column) or the name (displayed in the final column). E.g., given: $ docker ps d2d4a89aaee9 larsks/mini-httpd "mini_httpd -d /cont 7 days ago Up 7 days web I can run: $ docker exec -it web ip addr 1: lo: mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 18: eth0: mtu 1500 qdisc noqueue state UP link/ether 02:42:ac:11:00:03 brd ff:ff:ff:ff:ff:ff inet 172.17.0.3/16 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::42:acff:fe11:3/64 scope link valid_lft forever preferred_lft forever I could accomplish the same thing by running: $ docker exec -it d2d4a89aaee9 ip addr Similarly, I could start a shell in the container; $ docker exec -it web sh / # echo This is inside the container. This is inside the container. / # exit $ In commands shown in this answer, the -i and -t options (combined as -it ) are necessary to get an interactive shell: -i keeps stdin connected; if you don't specify -i , the shell will simply exit. -t allocates a tty device; if you don't specify -t , you won't have a very pleasant interactive experience (there will be no shell prompt or job control, for example). If you're specifically using docker compose , there is a convenience docker compose exec command that works very much like the docker exec command, except: It defaults to the behavior of -i and -t It allows you to refer to containers by their service name in your compose.yaml file. For example, if you have a compose.yaml like this: services: web: image: docker.io/alpinelinux/darkhttpd Then you can run: docker compose exec web sh The equivalent docker exec command would be something like: docker exec -it myproject-web-1 sh (/a/30173220) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/30173220/edit) () Improve this answer Follow (70:3:31e,16:4029c33bb70096aa,10:1725240214,16:05e8b7b86e919c3a,8:30173220,c393b2b7061cca01f8a23c8abeb082d9ca6b0add9bb97bfffbc7b74a132ec215) Follow this answer to receive notifications (/posts/30173220/revisions) (show all edits to this post) edited (2024-07-26 15:33:17Z) Jul 26 at 15:33 answered (2015-05-11 16:44:52Z) May 11, 2015 at 16:44 (/users/147356/larsks) (larsks's user avatar) (/users/147356/larsks) larsks larsks (reputation score 303,927) 304k (41 gold badges) 41 41 gold badges (442 silver badges) 442 442 silver badges (451 bronze badges) 451 451 bronze badges 17 (number of 'useful comment' votes received) 174 Also, docker exec only works on running containers (otherwise use docker run -it --entrypoint /bin/bash or similar). – (/users/1227991/l0j1k) (12,494 reputation) L0j1k Commented (2015-05-11 17:17:56Z, License: CC BY-SA 3.0) May 11, 2015 at 17:17 (number of 'useful comment' votes received) 105 for your convenience, -it is a combination of -i and -t which is --interactive ("Keep STDIN open even if not attached") respectively --tty (" Allocate a pseudo-TTY"). – (/users/1388892/adrian-f%c3%b6der) (881 reputation) Adrian Föder Commented (2017-06-08 12:45:27Z, License: CC BY-SA 3.0) Jun 8, 2017 at 12:45 (number of 'useful comment' votes received) 60 On Alpine Linux based containers you might not have bash, so if so, use sh instead. – (/users/495796/robin-green) (32,835 reputation) Robin Green Commented (2018-03-11 08:28:56Z, License: CC BY-SA 3.0) Mar 11, 2018 at 8:28 (number of 'useful comment' votes received) 48 @L0j1k it is docker run -it --entrypoint /bin/bash --any --more --args , just to clarify for people – (/users/1223975/alexander-mills) (98,023 reputation) Alexander Mills Commented (2019-05-21 01:21:30Z, License: CC BY-SA 4.0) May 21, 2019 at 1:21 (this comment was edited 2 times) (number of 'useful comment' votes received) 3 @AlexanderMills Yes, and to clarify further, those --any --more --args you have will be fed into whatever the image has defined as its CMD and not Docker (or if your image only defines an ENTRYPOINT and no CMD , then these options will be fed into /bin/bash as you've specified here). So for example any other docker run options (e.g. --net "host" ) need to go before the . – (/users/1227991/l0j1k) (12,494 reputation) L0j1k Commented (2019-05-22 17:10:33Z, License: CC BY-SA 4.0) May 22, 2019 at 17:10 (this comment was edited 1 time) (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) | (Expand to show all comments on this post) Show 12 more comments This answer is useful (70:3:31e,16:082cf5fb67265e77,10:1725240214,16:27f14e0b6d543f0b,8:33060711,d78ab07e564a4db2c6b8e7561ccd3a8f76b59808939d72847faf7fd588604a73) 522 (This answer is not useful) (70:3:31e,16:705f2fd05d9301ef,10:1725240214,16:1fcc1cb975db8923,8:33060711,370d001011fd9bb898eaea6fad6ec299e28666fb4d4ffbb7f398a5e181a7f0b2) Save this answer. (Loading when this answer was accepted…) (/posts/33060711/timeline) Show activity on this post. To bash into a running container, type this: docker exec -t -i container_name /bin/bash or docker exec -ti container_name /bin/bash or docker exec -ti container_name sh (/a/33060711) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/33060711/edit) () Improve this answer Follow (70:3:31e,16:5b270223c6c9eb41,10:1725240214,16:03f0e96f411c91c2,8:33060711,113b6d00c3f72bea8c6377b3a032a03c0f4bd3988c136e814f8f2e7d09e3e436) Follow this answer to receive notifications (/posts/33060711/revisions) (show all edits to this post) edited (2020-01-15 22:44:52Z) Jan 15, 2020 at 22:44 answered (2015-10-11 01:34:24Z) Oct 11, 2015 at 1:34 (/users/791694/agust%c3%ad-s%c3%a1nchez) (Agustí Sánchez's user avatar) (/users/791694/agust%c3%ad-s%c3%a1nchez) Agustí Sánchez Agustí Sánchez (reputation score 11,053) 11.1k (2 gold badges) 2 2 gold badges (35 silver badges) 35 35 silver badges (27 bronze badges) 27 27 bronze badges 10 (number of 'useful comment' votes received) 2 Presuming it is a Linux container? – (/users/63550/peter-mortensen) (31,461 reputation) Peter Mortensen Commented (2018-08-05 13:14:56Z, License: CC BY-SA 4.0) Aug 5, 2018 at 13:14 (number of 'useful comment' votes received) 13 /bin/bash wasnt required just bash did it for me – (/users/3002336/anand-varkey-philips) (2,049 reputation) Anand Varkey Philips Commented (2018-11-25 15:19:04Z, License: CC BY-SA 4.0) Nov 25, 2018 at 15:19 (number of 'useful comment' votes received) 23 I would prefer docker exec -it instead of docker exec -t -i – (/users/4199880/vato) (3,026 reputation) VaTo Commented (2019-03-01 21:39:20Z, License: CC BY-SA 4.0) Mar 1, 2019 at 21:39 (this comment was edited 2 times) (number of 'useful comment' votes received) 2 @nakamin According to the docs, adding the -u or --user flag will allow you to specify the user. (https://docs.docker.com/engine/reference/commandline/exec/) docs.docker.com/engine/reference/commandline/exec – (/users/4102523/tww0003) (829 reputation) tww0003 Commented (2021-04-06 22:00:09Z, License: CC BY-SA 4.0) Apr 6, 2021 at 22:00 just bash will work out instead on /bin/bash – (/users/10053166/aditya) (428 reputation) Aditya Commented (2022-03-19 07:12:48Z, License: CC BY-SA 4.0) Mar 19, 2022 at 7:12 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) | (Expand to show all comments on this post) Show 5 more comments This answer is useful (70:3:31e,16:e33923e44cec6dec,10:1725240214,16:885040fabe429328,8:37246331,6e35e61345938aeb389ee45e167a7edcd3cd6638a0ef85e7579a8642e46464ef) 129 (This answer is not useful) (70:3:31e,16:97c3fc6e9082faf2,10:1725240214,16:650d34d99f7b069a,8:37246331,8e8c8bba0d5e8bd47668618d90d4500b4c6822b4f71659e01d3a9f97cdf6d1e8) Save this answer. (Loading when this answer was accepted…) (/posts/37246331/timeline) Show activity on this post. Historical note: At the time I wrote this answer, the title of the question was: "How to ssh into a docker container?" As other answers have demonstrated, it is common to execute and interact with preinstalled commands (including shells) in a locally-accessible running container using (https://docs.docker.com/engine/reference/commandline/exec/) docker exec , rather than SSH : docker exec -it (container) (command) Note: The below answer is based on Ubuntu (of 2016). Some translation of the installation process will be required for non-Debian containers. Let's say, for reasons that are your own, you really do want to use SSH. It takes a few steps, but it can be done. Here are the commands that you would run inside the container to set it up... apt-get update apt-get install openssh-server mkdir /var/run/sshd chmod 0755 /var/run/sshd /usr/sbin/sshd useradd --create-home --shell /bin/bash --groups sudo username ## includes 'sudo' passwd username ## Enter a password apt-get install x11-apps ## X11 demo applications (optional) ifconfig | awk '/inet addr/{print substr($2,6)}' ## Display IP address (optional) Now you can even run graphical applications (if they are installed in the container) using X11 forwarding to the SSH client: ssh -X username@IPADDRESS xeyes ## run an X11 demo app in the client Here are some related resources: (https://unix.stackexchange.com/q/178337/6764) openssh-server doesn't start in Docker container (https://askubuntu.com/q/505506/11522) How to get bash or ssh into a running container in background mode? (https://stackoverflow.com/q/16296753) Can you run GUI applications in a Linux Docker container? Other useful approaches for graphical access found with search: Docker X11 (https://jpetazzo.github.io/2014/06/23/docker-ssh-considered-evil) If you run SSHD in your Docker containers, you're doing it wrong! (/a/37246331) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/37246331/edit) () Improve this answer Follow (70:3:31e,16:4f1016cb0a86d85c,10:1725240214,16:059da58c8bc09a9e,8:37246331,4a4696f87e0c71fffb18e9548f7601a12cf4945ecd8c32e0b5ec0e665b2d9932) Follow this answer to receive notifications (/posts/37246331/revisions) (show all edits to this post) edited (2021-08-09 17:08:38Z) Aug 9, 2021 at 17:08 answered (2016-05-16 03:36:26Z) May 16, 2016 at 3:36 (/users/86967/brent-bradburn) (Brent Bradburn's user avatar) (/users/86967/brent-bradburn) Brent Bradburn Brent Bradburn (reputation score 54,191) 54.2k (18 gold badges) 18 18 gold badges (161 silver badges) 161 161 silver badges (182 bronze badges) 182 182 bronze badges 2 (number of 'useful comment' votes received) 3 At the time I wrote this answer, the title of the question was: "How to ssh into a docker container?" Over the years, the question and answers have been edited by interlopers and bots -- in some cases, possibly changing the intent. My previous comment to this effect was anonymously deleted. – (/users/86967/brent-bradburn) (54,191 reputation) Brent Bradburn Commented (2021-08-09 16:22:11Z, License: CC BY-SA 4.0) Aug 9, 2021 at 16:22 (this comment was edited 2 times) (number of 'useful comment' votes received) 1 (https://meta.stackoverflow.com/q/293826/86967) How many edits automatically turn my answer into a Community Wiki answer? – (/users/86967/brent-bradburn) (54,191 reputation) Brent Bradburn Commented (2021-08-09 16:28:42Z, License: CC BY-SA 4.0) Aug 9, 2021 at 16:28 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:4cc3abd980c2b8e9,10:1725240214,16:00f5f85d653252d0,8:53220818,670943c21470f49439ca1dc39d74bbd36742f62ec4761332f9c0ecf846dade19) 76 (This answer is not useful) (70:3:31e,16:b6ac2e026a1f4358,10:1725240214,16:00560d8cb1398032,8:53220818,26f19a123883159405634887b7c996ee5b93ff491b90bd66fc2a7e0b8be1cb11) Save this answer. (Loading when this answer was accepted…) (/posts/53220818/timeline) Show activity on this post. If the container has already exited (maybe due to some error), you can do: $ docker run --rm -it --entrypoint /bin/bash image_name or $ docker run --rm -it --entrypoint /bin/sh image_name or $ docker run --rm -it --entrypoint /bin/bash image_name to create a new container and get a shell into it. Here is the breakdown of the command: --rm: This option specifies that the container should be automatically removed when it is finished. -it: These options allow the container to be run interactively with a pseudo-tty terminal. The -i option stands for interactive mode and the -t option stands for a pseudo-tty terminal. --entrypoint /bin/bash: This option specifies the entry point for the container as /bin/bash, which is the shell program. image_name: This is the name of the Docker image on which the container will be based. Since you specified --rm, the container would be deleted when you exit the shell. (/a/53220818) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/53220818/edit) () Improve this answer Follow (70:3:31e,16:d153c7e88a73bdd2,10:1725240214,16:50ef3d445b093ec8,8:53220818,44d0d9551fa6a71b019b76c616e0f1d18c23b86955af592bf8b6cb899a80db76) Follow this answer to receive notifications (/posts/53220818/revisions) (show all edits to this post) edited (2023-03-28 00:15:47Z) Mar 28, 2023 at 0:15 (/users/13452914/zhymabek-roman) (Zhymabek Roman's user avatar) (/users/13452914/zhymabek-roman) Zhymabek Roman (reputation score) 45 (1 gold badge) 1 1 gold badge (2 silver badges) 2 2 silver badges (11 bronze badges) 11 11 bronze badges answered (2018-11-09 06:26:28Z) Nov 9, 2018 at 6:26 (/users/674669/user674669) (user674669's user avatar) (/users/674669/user674669) user674669 user674669 (reputation score 11,998) 12k (20 gold badges) 20 20 gold badges (84 silver badges) 84 84 silver badges (114 bronze badges) 114 114 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:6ab75572d9989589,10:1725240214,16:0a9a53d0318bafac,8:47469991,3c89104cd37b8420370bd9a331e0f983ca8fbf98488a9564239e09e18480a68b) 55 (This answer is not useful) (70:3:31e,16:c007eca88c937cd0,10:1725240214,16:d661eb368aa9f4e7,8:47469991,709b47368038a112199da8d1280c797b082877b14b2bb3de4e11249290958316) Save this answer. (Loading when this answer was accepted…) (/posts/47469991/timeline) Show activity on this post. If you're here looking for a Docker Compose-specific answer like I was, it provides an easy way in without having to look up the generated container ID. docker-compose exec takes the name of the service as per your docker-compose.yml file. So to get a Bash shell for your 'web' service, you can do: $ docker-compose exec web bash (/a/47469991) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/47469991/edit) () Improve this answer Follow (70:3:31e,16:a3f9d8d803c2c6fd,10:1725240214,16:7d3f8a19fb656d87,8:47469991,b589ab3933792312b9c77dcab2a765e8bb81bf741576bddca2d780f0d1f49705) Follow this answer to receive notifications (/posts/47469991/revisions) (show all edits to this post) edited (2018-08-05 18:34:33Z) Aug 5, 2018 at 18:34 (/users/63550/peter-mortensen) (Peter Mortensen's user avatar) (/users/63550/peter-mortensen) Peter Mortensen (reputation score 31,461) 31.5k (22 gold badges) 22 22 gold badges (109 silver badges) 109 109 silver badges (132 bronze badges) 132 132 bronze badges answered (2017-11-24 09:21:39Z) Nov 24, 2017 at 9:21 (/users/149998/bcmcfc) (bcmcfc's user avatar) (/users/149998/bcmcfc) bcmcfc bcmcfc (reputation score 26,537) 26.5k (29 gold badges) 29 29 gold badges (112 silver badges) 112 112 silver badges (183 bronze badges) 183 183 bronze badges 1 docker-compose run works as well, if your container doesn't exist yet. – (/users/2850770/paul) (144 reputation) Paul Commented (2020-04-01 19:15:21Z, License: CC BY-SA 4.0) Apr 1, 2020 at 19:15 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:9258a86b82ddd089,10:1725240214,16:388f4d6c4111b870,8:33776520,754aecfc7ab9a3889aabb61465d8dd837861e0bb027d25a38ea43826ac6fba3a) 32 (This answer is not useful) (70:3:31e,16:eab19cd2f0368e63,10:1725240214,16:a29ced6ff4c09698,8:33776520,435eedacf1f760b84b7f0bbb93f611d3cc87242f1a26c694d5133842739cc68a) Save this answer. (Loading when this answer was accepted…) (/posts/33776520/timeline) Show activity on this post. Start a session into a Docker container using this command: sudo docker exec -i -t (container ID) bash (/a/33776520) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/33776520/edit) () Improve this answer Follow (70:3:31e,16:2a005442cc93afcf,10:1725240214,16:01daed01e887a29e,8:33776520,dad0ad96895e54f8f6f5c3de568f3e086302b1ebbbce20c810d94c74a539bff4) Follow this answer to receive notifications (/posts/33776520/revisions) (show all edits to this post) edited (2021-06-19 15:46:41Z) Jun 19, 2021 at 15:46 answered (2015-11-18 09:43:50Z) Nov 18, 2015 at 9:43 (/users/3691226/tjs) (Tjs's user avatar) (/users/3691226/tjs) Tjs Tjs (reputation score) 857 (10 silver badges) 10 10 silver badges (17 bronze badges) 17 17 bronze badges 2 (number of 'useful comment' votes received) 2 or a little shorter: sudo docker exec -it bash – (/users/3995261/yakovl) (8,106 reputation) YakovL Commented (2021-09-22 12:34:49Z, License: CC BY-SA 4.0) Sep 22, 2021 at 12:34 or even shorter docker exec -it sh :) – (/users/6141587/deadcoder0904) (8,266 reputation) deadcoder0904 Commented (2024-02-15 07:31:08Z, License: CC BY-SA 4.0) Feb 15 at 7:31 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:9d59ab9f3896435c,10:1725240214,16:19093ab55b22803a,8:32927420,a88e67d6ddbe591642da0790d049bf98690314542a5f33a2b6680b842f8ee5ed) 30 (This answer is not useful) (70:3:31e,16:615e53bbb986d048,10:1725240214,16:077d60a4ab706b8b,8:32927420,195d751690136be366b07cb63597c1be97ff9ec4a916aec3831c4495401ef423) Save this answer. (Loading when this answer was accepted…) (/posts/32927420/timeline) Show activity on this post. Notice : this answer promotes a tool I've written. I've created a containerized SSH server that you can 'stick' to any running container. This way you can create compositions with every container. The only requirement is that the container has Bash. The following example would start an SSH server attached to a container with name 'my-container'. docker run -d -p 2222:22 \ -v /var/run/docker.sock:/var/run/docker.sock \ -e CONTAINER=my-container -e AUTH_MECHANISM=noAuth \ jeroenpeeters/docker-ssh ssh localhost -p 2222 When you connect to this SSH service (with your SSH client of choice) a Bash session will be started in the container with name 'my-container'. For more pointers and documentation see: (https://github.com/jeroenpeeters/docker-ssh) https://github.com/jeroenpeeters/docker-ssh (/a/32927420) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/3.0/) (The current license for this post: CC BY-SA 3.0) CC BY-SA 3.0 (/posts/32927420/edit) () Improve this answer Follow (70:3:31e,16:3de78237640e3e56,10:1725240214,16:63a348c435f804cd,8:32927420,494a7462eae29a14f53ad8810980beae108fff0fb4159230c1056b8d7acf0773) Follow this answer to receive notifications (/posts/32927420/revisions) (show all edits to this post) edited (2017-05-25 19:19:09Z) May 25, 2017 at 19:19 (/users/63550/peter-mortensen) (Peter Mortensen's user avatar) (/users/63550/peter-mortensen) Peter Mortensen (reputation score 31,461) 31.5k (22 gold badges) 22 22 gold badges (109 silver badges) 109 109 silver badges (132 bronze badges) 132 132 bronze badges answered (2015-10-03 20:56:09Z) Oct 3, 2015 at 20:56 (/users/1132644/jeroen-peeters) (Jeroen Peeters's user avatar) (/users/1132644/jeroen-peeters) Jeroen Peeters Jeroen Peeters (reputation score) 1,998 (1 gold badge) 1 1 gold badge (20 silver badges) 20 20 silver badges (26 bronze badges) 26 26 bronze badges 3 (number of 'useful comment' votes received) 1 That's pretty sweet. The big advantage of doing it this way is you're getting a fully functional terminal. When I used the "docker exec" approach then I couldn't clear the terminal content, less was showing a warning each time I run it etc. Using Jeroen's container is giving me a much better experience so far. Just make sure to check out the documentation . The sample command in the response doesn't seem valid any more. – (/users/985512/rafa%c5%82-g) (1,670 reputation) Rafał G. Commented (2016-06-18 14:26:33Z, License: CC BY-SA 3.0) Jun 18, 2016 at 14:26 (this comment was edited 5 times) (number of 'useful comment' votes received) 1 it is a great tool. Do you know how can i use it as a jenkins pipeline docker agent? i Want jenkins to transfer some files by SCP to a remote host and execute them with SSH – (/users/3081007/gilson) (498 reputation) Gilson Commented (2019-02-04 18:34:35Z, License: CC BY-SA 4.0) Feb 4, 2019 at 18:34 (this comment was edited 1 time) Docker On Windows : docker run -d -p 2222:22 -v //var/run/docker.sock:/var/run/docker.sock -e CONTAINER=my-container -e AUTH_MECHANISM=noAuth --name node-manager jeroenpeeters/docker-ssh – (/users/8126658/ggo) (2,728 reputation) GGO Commented (2020-10-13 12:29:36Z, License: CC BY-SA 4.0) Oct 13, 2020 at 12:29 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:4b3b5fce2023f909,10:1725240214,16:a7090d608b34ba98,8:50055749,488507a253a2afa36fae057c9be573d1e705d467da4fa746a79633a148b65f7e) 28 (This answer is not useful) (70:3:31e,16:47a2b9e8f3a26966,10:1725240214,16:86b082b91b069281,8:50055749,de0e7a4ce792f264ee964c7704fdf974d42f1b1bad9b0a1d0af7ce28d68e2be6) Save this answer. (Loading when this answer was accepted…) (/posts/50055749/timeline) Show activity on this post. In some cases your image can be Alpine-based. In this case it will throw: OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"bash\": executable file not found in $PATH": unknown Because /bin/bash doesn't exist. Instead of this you should use: docker exec -it 9f7d99aa6625 ash or docker exec -it 9f7d99aa6625 sh (/a/50055749) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/50055749/edit) () Improve this answer Follow (70:3:31e,16:d17e035a143f4f5e,10:1725240214,16:8aaefb67e9403ea7,8:50055749,83c15218dbf1a37144c8af33b99a23de2e9fea22cf4faa95a0744d2addc13645) Follow this answer to receive notifications (/posts/50055749/revisions) (show all edits to this post) edited (2018-08-05 18:51:29Z) Aug 5, 2018 at 18:51 (/users/63550/peter-mortensen) (Peter Mortensen's user avatar) (/users/63550/peter-mortensen) Peter Mortensen (reputation score 31,461) 31.5k (22 gold badges) 22 22 gold badges (109 silver badges) 109 109 silver badges (132 bronze badges) 132 132 bronze badges answered (2018-04-27 05:26:30Z) Apr 27, 2018 at 5:26 (/users/2659915/deoxyseia) (Deoxyseia's user avatar) (/users/2659915/deoxyseia) Deoxyseia Deoxyseia (reputation score) 1,389 (18 silver badges) 18 18 silver badges (31 bronze badges) 31 31 bronze badges 0 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:8b4ea3e963d11ce7,10:1725240214,16:0ea854e48f17c1bc,8:42132256,758b351a6fb6ea0e49405c56ca119fb8b8c01c47f44655fd2117e589ff5bd2c1) 27 (This answer is not useful) (70:3:31e,16:71e5f4a2556a42b1,10:1725240214,16:24dd3f2278e858a2,8:42132256,1d774a54357ece3b60c23f5eb74213598c4034db4cb468d46deff94a8e62dac7) Save this answer. (Loading when this answer was accepted…) (/posts/42132256/timeline) Show activity on this post. If you're using Docker on Windows and want to get shell access to a container, use this: winpty docker exec -it sh Most likely, you already have (https://git-for-windows.github.io/) Git Bash installed. If you don't, make sure to install it. (/a/42132256) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/3.0/) (The current license for this post: CC BY-SA 3.0) CC BY-SA 3.0 (/posts/42132256/edit) () Improve this answer Follow (70:3:31e,16:2aa140b279834168,10:1725240214,16:0164726f8f96450d,8:42132256,2bb716a7dbbe792ddc06a72dd28090a4604d74eb7907ca9a478ddcf7411360ae) Follow this answer to receive notifications answered (2017-02-09 09:04:32Z) Feb 9, 2017 at 9:04 (/users/5100659/cosmin-ababei) (Cosmin Ababei's user avatar) (/users/5100659/cosmin-ababei) Cosmin Ababei Cosmin Ababei (reputation score) 7,032 (2 gold badges) 2 2 gold badges (21 silver badges) 21 21 silver badges (34 bronze badges) 34 34 bronze badges 1 (number of 'useful comment' votes received) 1 Presumes a Linux Docker container? – (/users/63550/peter-mortensen) (31,461 reputation) Peter Mortensen Commented (2018-08-05 13:35:38Z, License: CC BY-SA 4.0) Aug 5, 2018 at 13:35 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:9ef5da1d69f0c9ad,10:1725240214,16:076b3aaf737be0e3,8:44516594,fdcf1421b41840fb76047a66971a775806536533ad26773ac21d7cb79f26fab5) 21 (This answer is not useful) (70:3:31e,16:7ea51bf94bd91a54,10:1725240214,16:e4c7d3dd51c4f95e,8:44516594,efd0fbd297016e682336c14bb387a0b730e2b1f40c39f5bd9dae871fff1acb7d) Save this answer. (Loading when this answer was accepted…) (/posts/44516594/timeline) Show activity on this post. To connect to cmd in a Windows container, use docker exec -it d8c25fde2769 cmd Where d8c25fde2769 is the container id. (/a/44516594) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/44516594/edit) () Improve this answer Follow (70:3:31e,16:38d4635ba0cc677b,10:1725240214,16:d31fa8bc020a1f72,8:44516594,dd0b28e380d19cdaabf1dc1ca8ee88cb1361525b5f6db695d6e4e64f373a44bd) Follow this answer to receive notifications (/posts/44516594/revisions) (show all edits to this post) edited (2018-08-05 13:38:50Z) Aug 5, 2018 at 13:38 (/users/63550/peter-mortensen) (Peter Mortensen's user avatar) (/users/63550/peter-mortensen) Peter Mortensen (reputation score 31,461) 31.5k (22 gold badges) 22 22 gold badges (109 silver badges) 109 109 silver badges (132 bronze badges) 132 132 bronze badges answered (2017-06-13 08:50:11Z) Jun 13, 2017 at 8:50 (/users/2942223/aqeel-qureshi) (Aqeel Qureshi's user avatar) (/users/2942223/aqeel-qureshi) Aqeel Qureshi Aqeel Qureshi (reputation score) 447 (1 gold badge) 1 1 gold badge (4 silver badges) 4 4 silver badges (10 bronze badges) 10 10 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:9ee76b4742d6010f,10:1725240214,16:b46cbba0c5d33187,8:77999033,eef34063651e4180f021fc58848961250c821d6c8522ddaa848a3c6e94ce39e6) 21 (This answer is not useful) (70:3:31e,16:dee138f737888b34,10:1725240214,16:6f989b3027baf2a4,8:77999033,773108990e07772cc633abf6ae4f37f29199856e8f4e23dcae78c95c12355cca) Save this answer. (Loading when this answer was accepted…) (/posts/77999033/timeline) Show activity on this post. 2024 version Use exec with sh as a short-form: docker exec -it sh You can find CONTAINER_ID (1st column) or CONTAINER_NAME (last column) by performing docker ps & get output that looks like: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 8e5611ba2567 nextjs:0.0.1 "docker-entrypoint.s…" 3 hours ago Up 3 hours 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp web f3967286c492 redis:7.2.4 "docker-entrypoint.s…" 3 hours ago Up 3 hours (healthy) 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp web_redis For nextjs:0.0.1 , CONTAINER_ID is 8e5611ba2567 & CONTAINER_NAME is web . To get into web container, type: docker exec -it 8e5611ba2567 sh # or docker exec -it web sh (both are same) For redis:7.2.4 , CONTAINER_ID is f3967286c492 & CONTAINER_NAME is web_redis . To get into web_redis container, type: docker exec -it f3967286c492 sh # or docker exec -it web_redis sh (both are same) (/a/77999033) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/77999033/edit) () Improve this answer Follow (70:3:31e,16:7bbb4d6f742f7e18,10:1725240214,16:f775882c3cccbba8,8:77999033,95922f0f3f976d96d076944af7f8881b456278378160ca516b2c7b2374204ced) Follow this answer to receive notifications (/posts/77999033/revisions) (show all edits to this post) edited (2024-03-04 10:22:32Z) Mar 4 at 10:22 answered (2024-02-15 07:32:20Z) Feb 15 at 7:32 (/users/6141587/deadcoder0904) (deadcoder0904's user avatar) (/users/6141587/deadcoder0904) deadcoder0904 deadcoder0904 (reputation score) 8,266 (16 gold badges) 16 16 gold badges (79 silver badges) 79 79 silver badges (195 bronze badges) 195 195 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:e026ada1cbd839d2,10:1725240214,16:dee2b3b42847ef62,8:49281442,26e6424289105be0d174b36fdb38859abc316a6085901701f64e04cb47e74bec) 15 (This answer is not useful) (70:3:31e,16:a7eabc8174669750,10:1725240214,16:c6f1473a01a78008,8:49281442,1f32599d99612d8e8a35b57251995142ade57c3148e82e0517015bc5b225db43) Save this answer. (Loading when this answer was accepted…) (/posts/49281442/timeline) Show activity on this post. GOINSIDE SOLUTION install goinside command line tool with: sudo npm install -g goinside and go inside a docker container with a proper terminal size with: goinside docker_container_name old answer We've put this snippet in ~/.profile : goinside(){ docker exec -it $1 bash -c "stty cols $COLUMNS rows $LINES && bash"; } export -f goinside Not only does this make everyone able to get inside a running container with: goinside containername It also solves a long lived (https://stackoverflow.com/questions/38786615/docker-number-of-lines-in-terminal-changing-inside-docker) problem about fixed Docker container terminal sizes . Which is very annoying if you face it. Also if you follow (https://stackoverflow.com/a/49281526/5284370) the link you'll have command completion for your docker container names too. (/a/49281442) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/49281442/edit) () Improve this answer Follow (70:3:31e,16:a375ff60f9eb46bb,10:1725240214,16:619c0a1b4f7ab23c,8:49281442,6ead3a5d04d3cecb09b50a4371e49fddc0269bbe8962951452f3b77ef887a0e5) Follow this answer to receive notifications (/posts/49281442/revisions) (show all edits to this post) edited (2018-08-13 09:58:06Z) Aug 13, 2018 at 9:58 answered (2018-03-14 15:16:14Z) Mar 14, 2018 at 15:16 (/users/5284370/soorena) (Soorena's user avatar) (/users/5284370/soorena) Soorena Soorena (reputation score) 4,422 (5 gold badges) 5 5 gold badges (31 silver badges) 31 31 silver badges (43 bronze badges) 43 43 bronze badges 1 (number of 'useful comment' votes received) 1 Thanks. It works like a charm, at least for those images which have bash already included. Might not work for alpine based images, however, can be fixed with a different function specifically written for sh/ash etc. – (/users/2390276/gaurav-bhaskar) (305 reputation) Gaurav Bhaskar Commented (2018-06-15 22:35:22Z, License: CC BY-SA 4.0) Jun 15, 2018 at 22:35 (this comment was edited 1 time) (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:7c5ea821819c58c4,10:1725240214,16:8a3d8423d123f730,8:46268222,ce4f1ea15daab053c55113263c1d0c7c67009239aceb553bdc54d151cf204c92) 15 (This answer is not useful) (70:3:31e,16:83befb69c4b80782,10:1725240214,16:954006de63e6fa92,8:46268222,65c6a5e2c231494b046c0166ca775be828437b05c6bc346606ca3aa971612d7e) Save this answer. (Loading when this answer was accepted…) (/posts/46268222/timeline) Show activity on this post. To inspect files, run docker run -it /bin/sh to get an interactive terminal. The list of images can be obtained by docker images . In contrary to docker exec this solution works also in case when an image doesn't start (or quits immediately after running). (/a/46268222) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/46268222/edit) () Improve this answer Follow (70:3:31e,16:94f72d6e1f153a81,10:1725240214,16:a21e17f265b51042,8:46268222,f32e14f197679c258a81b961995e5cd4c16540f655a481798a105082cb50caba) Follow this answer to receive notifications (/posts/46268222/revisions) (show all edits to this post) edited (2020-01-13 20:04:18Z) Jan 13, 2020 at 20:04 answered (2017-09-17 19:45:59Z) Sep 17, 2017 at 19:45 (/users/1795220/igo) (igo's user avatar) (/users/1795220/igo) igo igo (reputation score) 6,688 (6 gold badges) 6 6 gold badges (43 silver badges) 43 43 silver badges (51 bronze badges) 51 51 bronze badges 1 Presuming a Linux Docker image? – (/users/63550/peter-mortensen) (31,461 reputation) Peter Mortensen Commented (2018-08-05 13:44:45Z, License: CC BY-SA 4.0) Aug 5, 2018 at 13:44 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:c79bb96c44f02467,10:1725240214,16:219b6473fab1a17e,8:71635364,a2c60b55f84e8e6ab3463be517685cfde10292a329447457ac3ee6b96aa30338) 15 (This answer is not useful) (70:3:31e,16:a724ab1cc07288e5,10:1725240214,16:479adc267a5f0034,8:71635364,a83808c145ae2fe4116b66833c2fcc82e693c117ca2c2a9fd5eeb1b3a66d27c1) Save this answer. (Loading when this answer was accepted…) (/posts/71635364/timeline) Show activity on this post. 2022 Solution Consider another option Why do you need it? There is a bunch of modern docker-images that are based on (https://github.com/GoogleContainerTools/distroless) distroless base images (they don't have /bin/bash either /bin/sh ) so it becomes impossible to docker exec -it {container-name} bash into them. How to shell-in any container Use (https://github.com/artemkaxboy/docker-opener) opener : requires to (https://github.com/artemkaxboy/docker-opener#installation) add alias in your environment opener wordpress works anywhere docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock artemkaxboy/opener wordpress Instead of wordpress you can use name or id or image-name of any container you want to connect How it works (https://github.com/artemkaxboy/docker-opener) Opener is a set of python scripts wrapped-up to a docker image. It finds target container by any unique attribute (name, id, port, image), tries to connect to target using bash . If bash is not found opener tries to connect using sh . Finally if sh is not found either opener installs busybox into target container and connects to the target using busybox shell, opener deletes busybox during disconnection. (/a/71635364) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/71635364/edit) () Improve this answer Follow (70:3:31e,16:292e22f9dd69b4b1,10:1725240214,16:aec2878bccc6f1b6,8:71635364,fe3a321d2c8fef6d3fbe4ac258eee56ee048bf877b0bd8acac05f4a2ae43175e) Follow this answer to receive notifications (/posts/71635364/revisions) (show all edits to this post) edited (2022-03-27 10:52:03Z) Mar 27, 2022 at 10:52 answered (2022-03-27 10:02:40Z) Mar 27, 2022 at 10:02 (/users/1452052/artemkaxboy) (artemkaxboy's user avatar) (/users/1452052/artemkaxboy) artemkaxboy artemkaxboy (reputation score) 608 (6 silver badges) 6 6 silver badges (12 bronze badges) 12 12 bronze badges 2 (number of 'useful comment' votes received) 1 That is very cool, I tried this and it works great. I love how simple the scripts are that it runs. I never would have thought to try installing busybox in order to get a shell environment working in a docker container. – (/users/12779135/senorcardgage) (184 reputation) SenorCardgage Commented (2022-07-22 16:53:12Z, License: CC BY-SA 4.0) Jul 22, 2022 at 16:53 Love how simple this is. Shell alias set, so this it the last time I'll have to go looking for help on this. Thank you for the tool! – (/users/1749551/nick-k9) (4,504 reputation) Nick K9 Commented (2022-10-25 10:46:54Z, License: CC BY-SA 4.0) Oct 25, 2022 at 10:46 (this comment was edited 2 times) (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:df31577602fd9efb,10:1725240214,16:ea6359c136dff212,8:51301104,6c62a1bc8abd1f583c9b38496695afdd526e1291853e0275cb2da303f889278d) 14 (This answer is not useful) (70:3:31e,16:7f05d1711d8bc7dc,10:1725240214,16:bd373300cddc9223,8:51301104,a4eb56b0c46f25a2696d8819af27eba8173ba1f9348c7029adc1fdfa88fe4191) Save this answer. (Loading when this answer was accepted…) (/posts/51301104/timeline) Show activity on this post. It is simple ! List out all your Docker images: sudo docker images On my system it showed the following output: REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE bash latest 922b9cc3ea5e 9 hours ago 14.03 MB ubuntu latest 7feff7652c69 5 weeks ago 81.15 MB I have two Docker images on my PC. Let's say I want to run the first one. sudo docker run -i -t ubuntu:latest /bin/bash This will give you terminal control of the container. Now you can do all type of shell operations inside the container. Like doing ls will output all folders in the root of the file system. bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var (/a/51301104) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/51301104/edit) () Improve this answer Follow (70:3:31e,16:5ce2df240436ca98,10:1725240214,16:5aa6b2f337c70e3a,8:51301104,aa081053594b467e320b4fbba6d758bbc0359a19028095acb946d4f16f7bb80d) Follow this answer to receive notifications (/posts/51301104/revisions) (show all edits to this post) edited (2018-08-05 18:54:01Z) Aug 5, 2018 at 18:54 (/users/63550/peter-mortensen) (Peter Mortensen's user avatar) (/users/63550/peter-mortensen) Peter Mortensen (reputation score 31,461) 31.5k (22 gold badges) 22 22 gold badges (109 silver badges) 109 109 silver badges (132 bronze badges) 132 132 bronze badges answered (2018-07-12 08:47:42Z) Jul 12, 2018 at 8:47 (/users/2764243/patel-sunil) (Patel Sunil's user avatar) (/users/2764243/patel-sunil) Patel Sunil Patel Sunil (reputation score) 461 (7 silver badges) 7 7 silver badges (7 bronze badges) 7 7 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:a475de0ed6a27a82,10:1725240214,16:7ee912d66f3f68c6,8:57053212,b7e6e718cef1b62e6d2321fb9c9faa38ce784799c153930af486c621d721c055) 12 (This answer is not useful) (70:3:31e,16:742fd3bb7ba1a3ce,10:1725240214,16:60c4c09152338694,8:57053212,cb128e1dc59314c831765da3a2de18a5cec996dfd3b05aef12994e68faaa080c) Save this answer. (Loading when this answer was accepted…) (/posts/57053212/timeline) Show activity on this post. I've created a terminal function for easier access to the container's terminal. Maybe it's useful to you guys as well: So the result is, instead of typing: docker exec -it [container_id] /bin/bash you'll write: dbash [container_id] Put the following in your ~/.bash_profile (or whatever else that works for you), then open a new terminal window and enjoy the shortcut: #usage: dbash [container_id] dbash() { docker exec -it "$1" /bin/bash } (/a/57053212) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/57053212/edit) () Improve this answer Follow (70:3:31e,16:22381301671349ec,10:1725240214,16:d33ccec000c747b2,8:57053212,030ceb08de85357e5c7db2b5ff3cce12f7a0f33fd17bc5a7608177487e7eea12) Follow this answer to receive notifications answered (2019-07-16 08:34:57Z) Jul 16, 2019 at 8:34 (/users/2678741/guy) (Guy's user avatar) (/users/2678741/guy) Guy Guy (reputation score) 1,322 (18 silver badges) 18 18 silver badges (19 bronze badges) 19 19 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:17005f35d4c4cea1,10:1725240214,16:8cf98d1cb2e499f4,8:54301940,57980387248b1647dd6f6dbaba62f73cd3d23ec522d003850eea6ce35e9ec363) 10 (This answer is not useful) (70:3:31e,16:9de337bccd1d3e61,10:1725240214,16:953c887870f09b95,8:54301940,a528cc6f46d57beabc13173fd91188355c7cf7e6e6afb7b6bf46045b6a8d0216) Save this answer. (Loading when this answer was accepted…) (/posts/54301940/timeline) Show activity on this post. $ docker exec -it /bin/bash Or depending on the shell, it can be $ docker exec -it /bin/sh You can get the container-Id via docker ps command -i = interactive -t = to allocate a psuedo-TTY (/a/54301940) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/54301940/edit) () Improve this answer Follow (70:3:31e,16:078506222d7da320,10:1725240214,16:3b8277a001a27f8c,8:54301940,b10a3e49982390402123cbbb03e5b19050549f63f79a361dc0968dbdc87674d4) Follow this answer to receive notifications (/posts/54301940/revisions) (show all edits to this post) edited (2019-05-24 12:22:37Z) May 24, 2019 at 12:22 (/users/33204/slm) (slm's user avatar) (/users/33204/slm) slm (reputation score 16,140) 16.1k (13 gold badges) 13 13 gold badges (114 silver badges) 114 114 silver badges (128 bronze badges) 128 128 bronze badges answered (2019-01-22 05:46:43Z) Jan 22, 2019 at 5:46 (/users/3904327/ashutosh-chamoli) (Ashutosh Chamoli's user avatar) (/users/3904327/ashutosh-chamoli) Ashutosh Chamoli Ashutosh Chamoli (reputation score) 1,007 (1 gold badge) 1 1 gold badge (12 silver badges) 12 12 silver badges (27 bronze badges) 27 27 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:64a6cb02f0acc2bf,10:1725240214,16:bc5e32445c0f6011,8:55107579,e970195909b0ad78e6b36279d6faad9d4640e2be1e7942219aa29ea88ad02f1c) 8 (This answer is not useful) (70:3:31e,16:cd98584ce84a265e,10:1725240214,16:a10c8b8858cdaa7a,8:55107579,edeb18de25b3778fc9ea5d9fb7e1edcfa3c19d706c610c407d85f2f8e9479a53) Save this answer. (Loading when this answer was accepted…) (/posts/55107579/timeline) Show activity on this post. you can interact with the terminal in docker container by passing the option -ti docker run --rm -ti eg: docker run --rm -ti ubuntu -t stands for terminal -i stands for interactive (/a/55107579) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/55107579/edit) () Improve this answer Follow (70:3:31e,16:2577503924607c6c,10:1725240214,16:08e85da0e91a120b,8:55107579,433399983569d2c34cf216a2ab722909b9edcb3ceade448b014888736dad77e5) Follow this answer to receive notifications answered (2019-03-11 17:46:09Z) Mar 11, 2019 at 17:46 (/users/7788325/alwin) (Alwin's user avatar) (/users/7788325/alwin) Alwin Alwin (reputation score) 153 (1 silver badge) 1 1 silver badge (6 bronze badges) 6 6 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:10508188fb3213c7,10:1725240214,16:4feb7c6ce16503d9,8:62123828,7cea11811f4346641f2fa1cabde7b72ff4cc1ffcf48a6514b66becf987f3523a) 8 (This answer is not useful) (70:3:31e,16:51ad5ea37a8a99bc,10:1725240214,16:04cc1a10107d86ab,8:62123828,b0b08aab1fea913317b3765719a7cef6a6496af9fb9de64fadcf0dc8120fe2eb) Save this answer. (Loading when this answer was accepted…) (/posts/62123828/timeline) Show activity on this post. To exec into a running container named test , below is the following commands If the container has bash shell docker exec -it test /bin/bash If the container has bourne shell and most of the cases it's present docker run -it test /bin/sh (/a/62123828) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/62123828/edit) () Improve this answer Follow (70:3:31e,16:28d8c21c38c38810,10:1725240214,16:6df040b24373fceb,8:62123828,3057e1bbfac8f59363a7cb79216f88b9465ddbdfcec6bdbd01a8edce799af4e9) Follow this answer to receive notifications answered (2020-05-31 23:52:50Z) May 31, 2020 at 23:52 (/users/8090174/nischay-goyal) (nischay goyal's user avatar) (/users/8090174/nischay-goyal) nischay goyal nischay goyal (reputation score) 3,426 (1 gold badge) 1 1 gold badge (13 silver badges) 13 13 silver badges (23 bronze badges) 23 23 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:53e36125c5595f90,10:1725240214,16:097e7be23434b2a9,8:63058502,090d1324411573fdfb6766e01b2ce30ac1ff4a72d08031fd021dfa475d98e349) 8 (This answer is not useful) (70:3:31e,16:36bd9cac23d47128,10:1725240214,16:6f786aa1e1417038,8:63058502,60451313cef8a4fb89f86a0adf197d1730e8eddd903c3871eaa7b37dc16941de) Save this answer. (Loading when this answer was accepted…) (/posts/63058502/timeline) Show activity on this post. There are at least 2 options depending on the target. Option 1: Create a new bash process and join into it (easier) Sample start: docker exec -it /bin/bash Quit: type exit Pro: Does work on all containers (not depending on CMD/Entrypoint) Contra: Creates a new process with own session and own environment-vars Option 2: Attach to the already running bash (better) Sample start: docker attach --detach-keys ctrl-d Quit: use keys ctrl and d Pro: Joins the exact same running bash which is in the container. You have same the session and same environment-vars. Contra: Only works if CMD/Entrypoint is an interactive bash like CMD ["/bin/bash"] or CMD ["/bin/bash", "--init-file", "myfile.sh"] AND if container has been started with interactive options like docker run -itd (-i=interactive, -t=tty and -d=deamon [opt]) We found option 2 more useful. For example we changed apache2-foreground to a normal background apache2 and started a bash after that. (/a/63058502) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/63058502/edit) () Improve this answer Follow (70:3:31e,16:9bb577ad40983a7e,10:1725240214,16:a96714c0f35eb451,8:63058502,bbd6ca246af9bfb23573e82999c1f4557133fbe50a37282ca64bff0ed7750f50) Follow this answer to receive notifications (/posts/63058502/revisions) (show all edits to this post) edited (2020-08-04 16:01:40Z) Aug 4, 2020 at 16:01 answered (2020-07-23 16:04:16Z) Jul 23, 2020 at 16:04 (/users/1785179/terraloader) (terraloader's user avatar) (/users/1785179/terraloader) terraloader terraloader (reputation score) 331 (3 silver badges) 3 3 silver badges (10 bronze badges) 10 10 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:0d20979738bddcfd,10:1725240214,16:fa625b27856e2ae3,8:30182366,9f88f8aee53bb80149ace1b821724ca26f9c1efec028750eaa82ffe2f3e2a739) 7 (This answer is not useful) (70:3:31e,16:211837142009e432,10:1725240214,16:13753b84f6c5f6de,8:30182366,b4cc38d7775cb208a23895147ab0f3ce149a0ec07f7e915ffff73ccf38ef211e) Save this answer. (Loading when this answer was accepted…) (/posts/30182366/timeline) Show activity on this post. docker exec will definitely be a solution. An easy way to work with the question you asked is by mounting the directory inside Docker to the local system's directory . So that you can view the changes in local path instantly. docker run -v /Users/:/ (/a/30182366) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/3.0/) (The current license for this post: CC BY-SA 3.0) CC BY-SA 3.0 (/posts/30182366/edit) () Improve this answer Follow (70:3:31e,16:a7fd634d3b6f8500,10:1725240214,16:96d978656c54ffeb,8:30182366,a9ead828bfaf3cbba2b195477000dfdbfc6797516444e30c8193b4e0c8357d6e) Follow this answer to receive notifications (/posts/30182366/revisions) (show all edits to this post) edited (2017-05-25 19:17:53Z) May 25, 2017 at 19:17 (/users/63550/peter-mortensen) (Peter Mortensen's user avatar) (/users/63550/peter-mortensen) Peter Mortensen (reputation score 31,461) 31.5k (22 gold badges) 22 22 gold badges (109 silver badges) 109 109 silver badges (132 bronze badges) 132 132 bronze badges answered (2015-05-12 05:19:17Z) May 12, 2015 at 5:19 (/users/3003758/pratik) (Pratik's user avatar) (/users/3003758/pratik) Pratik Pratik (reputation score) 1,216 (11 silver badges) 11 11 silver badges (18 bronze badges) 18 18 bronze badges 2 (number of 'useful comment' votes received) 1 your command is actually mounting the host's directory into the container. – (/users/2394118/demonbane) (349 reputation) Demonbane Commented (2016-06-15 14:49:42Z, License: CC BY-SA 3.0) Jun 15, 2016 at 14:49 (this comment was edited 1 time) Yeah! Take a backup to another directory and then mount the volume, then move the backup to the mounted folder. – (/users/3003758/pratik) (1,216 reputation) Pratik Commented (2016-06-16 20:37:41Z, License: CC BY-SA 3.0) Jun 16, 2016 at 20:37 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:4b361ed22e680020,10:1725240214,16:169cea752cf0ea09,8:42009278,1b0c768e792bc3632859281c971c53bb07134b63d47285d46c137a3b1cbca3a1) 7 (This answer is not useful) (70:3:31e,16:5329e91452e8c784,10:1725240214,16:47590287982b6fb9,8:42009278,a1e91b58a2a8a3281d4da1cf299c099aa35efa1c30099fd4e1f0a7fd7a571e47) Save this answer. (Loading when this answer was accepted…) (/posts/42009278/timeline) Show activity on this post. Use: docker attach The other way, albeit there is a danger to it, is to use attach , but if you Ctrl + C to exit the session, you will also stop the container. If you just want to see what is happening, use docker logs -f . :~$ docker attach --help Usage: docker attach [OPTIONS] CONTAINER Attach to a running container Options: --detach-keys string Override the key sequence for detaching a container --help Print usage --no-stdin Do not attach STDIN --sig-proxy Proxy all received signals to the process (default true) (/a/42009278) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/42009278/edit) () Improve this answer Follow (70:3:31e,16:c0ca67e62a77b693,10:1725240214,16:ac0532f7fe540d27,8:42009278,4a7ea55a90164ce7c0ba7c3b4f89f5b99d3348f4e01aabf694b498d6faf47d96) Follow this answer to receive notifications (/posts/42009278/revisions) (show all edits to this post) edited (2018-08-05 13:34:48Z) Aug 5, 2018 at 13:34 (/users/63550/peter-mortensen) (Peter Mortensen's user avatar) (/users/63550/peter-mortensen) Peter Mortensen (reputation score 31,461) 31.5k (22 gold badges) 22 22 gold badges (109 silver badges) 109 109 silver badges (132 bronze badges) 132 132 bronze badges answered (2017-02-02 18:03:02Z) Feb 2, 2017 at 18:03 (/users/3228993/ramon) (Ramon's user avatar) (/users/3228993/ramon) Ramon Ramon (reputation score) 109 (1 silver badge) 1 1 silver badge (6 bronze badges) 6 6 bronze badges 0 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:9f1b32a505645f42,10:1725240214,16:aef60d553b4d5317,8:51539510,b80198dfd91f86eabd9213f116488bc4ba3e38dd9308c9701f602bb374f995f7) 7 (This answer is not useful) (70:3:31e,16:5eb06b0438b0f56d,10:1725240214,16:7d0e41a7aa0886a2,8:51539510,954d595cda063aa614b1dafcc5284f33e8940264ac6bbb70b7b508bb8b764a15) Save this answer. (Loading when this answer was accepted…) (/posts/51539510/timeline) Show activity on this post. Use this command: docker exec -it containerid /bin/bash (/a/51539510) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/51539510/edit) () Improve this answer Follow (70:3:31e,16:fab997461b48dfd8,10:1725240214,16:2dd3ab65ee06e723,8:51539510,1ff3ead470748158d58e186bb9f114cc6eaa573293b0762ed3de86b1d9100c45) Follow this answer to receive notifications (/posts/51539510/revisions) (show all edits to this post) edited (2018-10-25 07:10:55Z) Oct 25, 2018 at 7:10 answered (2018-07-26 13:02:34Z) Jul 26, 2018 at 13:02 (/users/10133024/admin-hack) (Admin Hack's user avatar) (/users/10133024/admin-hack) Admin Hack Admin Hack (reputation score) 67 (2 silver badges) 2 2 silver badges (4 bronze badges) 4 4 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:74d82f40c753536d,10:1725240214,16:d5714d5f4a0b53e0,8:74540446,e9c45ee8171ab5e7fd5956bc9ef93205f8af91ea194ab87713de2ae91762f6ee) 5 (This answer is not useful) (70:3:31e,16:f37dff13ecda9068,10:1725240214,16:6226c3ec06a412f1,8:74540446,f958e7b5d6f7d609bc81e4663d963779adae336911ca9437bebd3c03b72c28c3) Save this answer. (Loading when this answer was accepted…) (/posts/74540446/timeline) Show activity on this post. This is best if you don't want to specify an entry point in your docker build file.. sudo docker run -it --entrypoint /bin/bash (/a/74540446) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/74540446/edit) () Improve this answer Follow (70:3:31e,16:aa9bd062d1b29119,10:1725240214,16:8c6808161643236b,8:74540446,2c8a398bbebfa3a54f5e2e2e9700d8548232edcab71666afa3c49ab104c51a9e) Follow this answer to receive notifications (/posts/74540446/revisions) (show all edits to this post) edited (2023-07-05 00:27:58Z) Jul 5, 2023 at 0:27 answered (2022-11-23 00:20:00Z) Nov 23, 2022 at 0:20 (/users/2856444/magic-mick) (Magic Mick's user avatar) (/users/2856444/magic-mick) Magic Mick Magic Mick (reputation score) 1,523 (1 gold badge) 1 1 gold badge (21 silver badges) 21 21 silver badges (32 bronze badges) 32 32 bronze badges 1 Shouldn't it be instead of ? – (/users/620448/ulises) (13,369 reputation) Ulises Commented (2024-07-09 12:55:43Z, License: CC BY-SA 4.0) Jul 9 at 12:55 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:47bb12f7f9cf1bef,10:1725240214,16:46ab805a6106e1e3,8:50083237,3ab52ca96e67cf72e5d0397267170946d65e8fe9f8c1d9dff4ab919b8639078d) 4 (This answer is not useful) (70:3:31e,16:aaf052b2a4f08342,10:1725240214,16:bb35e2edce65deb5,8:50083237,b28902f9b3e03cf7a5af94a031332f06f7d924f37b2fa085e416bc30b0ea7175) Save this answer. (Loading when this answer was accepted…) (/posts/50083237/timeline) Show activity on this post. If you have Docker installed with Kitematic , you can use the GUI. Open Kitematic from the Docker icon and in the Kitematic window select your container, and then click on the exec icon. You can see the container log and lots of container information (in settings tab) in this GUI too. (https://i.sstatic.net/CIUnq.jpg) (Select Kitematic from menu) (https://i.sstatic.net/GDdTz.jpg) (Click on exec) (/a/50083237) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/50083237/edit) () Improve this answer Follow (70:3:31e,16:f6d9a2ec4009994f,10:1725240214,16:23c44cfb929b5686,8:50083237,705a3ad5f1635a79e09d1aa51b9263017d181b982466d524164593bb9a93c054) Follow this answer to receive notifications (/posts/50083237/revisions) (show all edits to this post) edited (2018-08-05 18:52:43Z) Aug 5, 2018 at 18:52 (/users/63550/peter-mortensen) (Peter Mortensen's user avatar) (/users/63550/peter-mortensen) Peter Mortensen (reputation score 31,461) 31.5k (22 gold badges) 22 22 gold badges (109 silver badges) 109 109 silver badges (132 bronze badges) 132 132 bronze badges answered (2018-04-29 03:56:44Z) Apr 29, 2018 at 3:56 (/users/2648077/alireza-fattahi) (Alireza Fattahi's user avatar) (/users/2648077/alireza-fattahi) Alireza Fattahi Alireza Fattahi (reputation score 44,810) 44.8k (14 gold badges) 14 14 gold badges (130 silver badges) 130 130 silver badges (184 bronze badges) 184 184 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:3d7517a3479d421c,10:1725240214,16:c1e0f5e940d993ee,8:71021611,5f9c9335e545c765d0c3a0faa7862d738c5b9457ae08278b57ef99c46f3400e2) 3 (This answer is not useful) (70:3:31e,16:de2b2d2b2edaff57,10:1725240214,16:e7fadff5bb4ced8f,8:71021611,577438747ae38ae7489c06a12cb9cf57b404339c09294d6d1f769fd20381e5fd) Save this answer. (Loading when this answer was accepted…) (/posts/71021611/timeline) Show activity on this post. There are two options we can connect to the docker terminal directly with these method shell and bash but usually bash is not supported and defualt sh is supported terminal To sh into the running container, type this: docker exec -it container_name/container_ID sh To bash into a running container, type this: docker exec -it container_name/container_ID bash and you want to use only bash terminal than you can install the bash terminal in your Dockerfile like RUN apt install bash -y (/a/71021611) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/71021611/edit) () Improve this answer Follow (70:3:31e,16:d5f974197963fcfd,10:1725240214,16:b92cd3c2c5595369,8:71021611,ce1a8841da6acb7fad86c56864b3277191505cdce1d0cc4f60c4060c3556eba9) Follow this answer to receive notifications (/posts/71021611/revisions) (show all edits to this post) edited (2022-02-09 16:27:07Z) Feb 9, 2022 at 16:27 answered (2022-02-07 16:02:44Z) Feb 7, 2022 at 16:02 (/users/8141440/muhammad-irfan-aslam) (Muhammad Irfan Aslam's user avatar) (/users/8141440/muhammad-irfan-aslam) Muhammad Irfan Aslam Muhammad Irfan Aslam (reputation score) 755 (9 silver badges) 9 9 silver badges (15 bronze badges) 15 15 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:a2294f9a113007fe,10:1725240214,16:60d550523cb2f68a,8:48581888,37b2162d643f8fee6e3c8f1e1e45ff45b52d7063efd8948e3e380bd949f1f0f2) 2 (This answer is not useful) (70:3:31e,16:d7300af98e6910a6,10:1725240214,16:cd27cd65d65b2965,8:48581888,a243a5f714d654f1c3fd432aa1b28690a8176e25552f1b8316e2caa5156c6975) Save this answer. (Loading when this answer was accepted…) (/posts/48581888/timeline) Show activity on this post. If you are using Docker Compose then this will take you inside a Docker container. docker-compose run container_name /bin/bash Inside the container it will take you to WORKDIR defined in the Dockerfile. You can change your work directory by WORKDIR directory_path # E.g /usr/src -> container's path (/a/48581888) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/48581888/edit) () Improve this answer Follow (70:3:31e,16:5e1d683755d5e878,10:1725240214,16:3c48ae06c6a58041,8:48581888,7a0217ed83fb18f42e73e05f9c86c961d791bc04b0c2259b65f5f9a489af0b78) Follow this answer to receive notifications (/posts/48581888/revisions) (show all edits to this post) edited (2018-08-05 18:47:32Z) Aug 5, 2018 at 18:47 (/users/63550/peter-mortensen) (Peter Mortensen's user avatar) (/users/63550/peter-mortensen) Peter Mortensen (reputation score 31,461) 31.5k (22 gold badges) 22 22 gold badges (109 silver badges) 109 109 silver badges (132 bronze badges) 132 132 bronze badges answered (2018-02-02 11:37:02Z) Feb 2, 2018 at 11:37 (/users/801343/sivakumar) (Sivakumar's user avatar) (/users/801343/sivakumar) Sivakumar Sivakumar (reputation score) 1,119 (1 gold badge) 1 1 gold badge (14 silver badges) 14 14 silver badges (25 bronze badges) 25 25 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:dae87f992bf1be17,10:1725240214,16:d54b5b7329c2b3f4,8:52158976,8be2a1c285d2da4b990a34ea131980c54f2d01563eab0d3aa120dc2eb9c70b63) 2 (This answer is not useful) (70:3:31e,16:4a2e491dad56ef39,10:1725240214,16:cac13a9f8cc00567,8:52158976,d4684ea9733a3d1a2e9300dfedfb7fb4e7cc22116f63fe0469bfd0d98b6a484e) Save this answer. (Loading when this answer was accepted…) (/posts/52158976/timeline) Show activity on this post. In my case, for some reason(s) I need to check all the network involved information in each container. So the following commands must be valid in a container... ip route netstat ps ... I checked through all these answers, none were helpful for me. I’ve searched information in other websites. I won’t add a super link here, since it’s not written in English. So I just put up this post with a summary solution for people who have the same requirements as me. Say you have one running container named light-test. Follow the steps below. docker inspect light-test -f {{.NetworkSettings.SandboxKey}} . This command will get reply like /var/run/docker/netns/xxxx . Then ln -s /var/run/docker/netns/xxxx /var/run/netns/xxxx . The directory may not exist, do mkdir /var/run/netns first. Now you may execute ip netns exec xxxx ip addr show to explore network world in container. PS. xxxx is always the same value received from the first command. And of course, any other commands are valid, i.e. ip netns exec xxxx netstat -antp|grep 8080 . (/a/52158976) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/52158976/edit) () Improve this answer Follow (70:3:31e,16:8050b88aa0984a8d,10:1725240214,16:575025435168a006,8:52158976,37b517a2540bec159792dfc0c5bcab6ec6ffa52a1f89fd65aa7b96c9956d9148) Follow this answer to receive notifications (/posts/52158976/revisions) (show all edits to this post) edited (2019-02-28 14:14:22Z) Feb 28, 2019 at 14:14 (/users/33204/slm) (slm's user avatar) (/users/33204/slm) slm (reputation score 16,140) 16.1k (13 gold badges) 13 13 gold badges (114 silver badges) 114 114 silver badges (128 bronze badges) 128 128 bronze badges answered (2018-09-04 04:48:54Z) Sep 4, 2018 at 4:48 (/users/8438999/light-g) (Light.G's user avatar) (/users/8438999/light-g) Light.G Light.G (reputation score) 6,884 (1 gold badge) 1 1 gold badge (15 silver badges) 15 15 silver badges (26 bronze badges) 26 26 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:537aa2fc32f1234c,10:1725240214,16:8fb4e4e256478b1e,8:77187998,f81766121518f6859b0dc31930cf6a5d2697a7ca8c51b47f7af8342ac0c7412d) 2 (This answer is not useful) (70:3:31e,16:a1092b5e516a882c,10:1725240214,16:5a008b502b87cf09,8:77187998,c270c01ea2d862df6b7e33a1c50889dbcb8ab3da4ab28e3bb08cd39827495478) Save this answer. (Loading when this answer was accepted…) (/posts/77187998/timeline) Show activity on this post. There is one more method I currently utilize, but I've been exploring a more user-friendly alternative. With the Windows (https://www.docker.com/products/docker-desktop/) Docker Desktop GUI , there's a feature that not only lets you open a direct shell on a container but also opens that shell in an external terminal. Essentially, it creates an instance of your selected terminal, and every command thereafter automatically utilizes 'docker exec -it ' without the need for manual input each time. (https://i.sstatic.net/jFnT3.png) (Docker Desktop) (/a/77187998) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/77187998/edit) () Improve this answer Follow (70:3:31e,16:85669ccb74814e98,10:1725240214,16:bebd4b6bf18c5b66,8:77187998,f0243fc1d98664441ab5e895eb87e759c2ee618926d811a6c4fd68486d899c0f) Follow this answer to receive notifications (/posts/77187998/revisions) (show all edits to this post) edited (2023-09-27 13:42:33Z) Sep 27, 2023 at 13:42 answered (2023-09-27 13:33:34Z) Sep 27, 2023 at 13:33 (/users/5896026/cristian-camilo-cabrera) (Cristian Camilo Cabrera's user avatar) (/users/5896026/cristian-camilo-cabrera) Cristian Camilo Cabrera Cristian Camilo Cabrera (reputation score) 148 (1 silver badge) 1 1 silver badge (10 bronze badges) 10 10 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:78a21b22975cec43,10:1725240214,16:cd32f774ce6ce8ee,8:77988094,1cc223ccb785ce56a04b08bec7030123a808eabbf7c5307afbf7dae8736163db) 2 (This answer is not useful) (70:3:31e,16:cbc1a9eadc92b1a1,10:1725240214,16:e83256cf3c374cf4,8:77988094,c1e3bcd5548a56cf8bb2244c5e4549cc5e7797ffd37df75ad736e9d6e1f055fa) Save this answer. (Loading when this answer was accepted…) (/posts/77988094/timeline) Show activity on this post. There now is an official docker command for this: docker debug It allows you to get a shell (bash/fish/zsh) into any container. It also works for stopped containers and images. Essentially it's a replacement of docker exec -it sh but with more features and less constraints (eg the debug shell has an install command to add further tools). Using docker debug does not modify your container/image (unless you explicitly do so, and only possible for running containers) See (https://docs.docker.com/engine/reference/commandline/debug/) official docs for more details and examples. Disclaimer: As of now, this is a paid feature and requires Docker Desktop >= 4.27. Ie., if you want to do this with docker-ce, docker exec -it sh still is the valid answer. (/a/77988094) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/77988094/edit) () Improve this answer Follow (70:3:31e,16:96889c096ee5f9fc,10:1725240214,16:adae2b7c9347557a,8:77988094,77e5fdff335bf2d34e779c7164904709693ec5083b79803b437f96000a290e7c) Follow this answer to receive notifications answered (2024-02-13 12:58:34Z) Feb 13 at 12:58 (/users/10258124/mr-cross) (Mr_Cross's user avatar) (/users/10258124/mr-cross) Mr_Cross Mr_Cross (reputation score) 101 (6 bronze badges) 6 6 bronze badges 4 docker: 'debug' is not a docker command. – (/users/1408676/gml-vs) (1,100 reputation) GML-VS Commented (2024-02-16 21:44:29Z, License: CC BY-SA 4.0) Feb 16 at 21:44 (number of 'useful comment' votes received) 1 Are you using docker desktop version 4.27 or higher? As mentioned in the disclaimer and in the referenced docs page, docker debug is a new command available as of docker desktop 4.27. – (/users/10258124/mr-cross) (101 reputation) Mr_Cross Commented (2024-02-18 15:31:53Z, License: CC BY-SA 4.0) Feb 18 at 15:31 Understood, thank you! I am using Rancher Desktop 1.12.3 with docker as a backend Client - Version: 24.0.7-rd (output of docker version command ) – (/users/1408676/gml-vs) (1,100 reputation) GML-VS Commented (2024-02-19 17:24:51Z, License: CC BY-SA 4.0) Feb 19 at 17:24 (this comment was edited 1 time) That feature is paywalled: "Docker Debug requires a Pro, Teams, or Business Subcription." – (/users/407700/oscar) (2,178 reputation) Oscar Commented (2024-07-10 16:29:23Z, License: CC BY-SA 4.0) Jul 10 at 16:29 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) 1 (/questions/30172605/how-do-i-get-into-a-docker-containers-shell?page=2&tab=scoredesc#tab-top) (Go to page 2) 2 (/questions/30172605/how-do-i-get-into-a-docker-containers-shell?page=2&tab=scoredesc#tab-top) (Go to page 2) Next (/help/privileges/protect-questions) Highly active question . Earn 10 reputation (not counting the (https://meta.stackexchange.com/questions/141648/what-is-the-association-bonus-and-how-does-it-work) association bonus ) in order to answer this question. The reputation requirement helps protect this question from spam and non-answer activity. Not the answer you're looking for? Browse other questions tagged (/questions/tagged/docker) (show questions tagged 'docker') docker (/questions/tagged/docker-container) (show questions tagged 'docker-container') docker-container or (/questions/ask) ask your own question . The Overflow Blog (https://stackoverflow.blog/2024/08/30/mobile-observability-open-telemetry-embrace-ios-android-austin-emmons/?cb=1) (Mobile Observability: monitoring performance through cracked screens, old batteries, and crappy Wi-Fi) Mobile Observability: monitoring performance through cracked screens, old... Featured on Meta (Meta Stack Exchange) (https://meta.stackexchange.com/questions/401324/announcing-a-change-to-the-data-dump-process?cb=1) Announcing a change to the data-dump process (Meta Stack Exchange) (https://meta.stackexchange.com/questions/402121/bringing-clarity-to-status-tag-usage-on-meta-sites?cb=1) Bringing clarity to status tag usage on meta sites (Meta Stack Overflow) (https://meta.stackoverflow.com/questions/431331/what-does-a-new-user-need-in-a-homepage-experience-on-stack-overflow?cb=1) What does a new user need in a homepage experience on Stack Overflow? (Meta Stack Overflow) (https://meta.stackoverflow.com/questions/431399/staging-ground-reviewer-motivation?cb=1) Staging Ground Reviewer Motivation (Meta Stack Overflow) (https://meta.stackoverflow.com/questions/431273/feedback-requested-how-do-you-use-tag-hover-descriptions-for-curating-and-do-yo?cb=1) (Feedback requested: How do you use tag hover descriptions for curating and do you use the RSS feed feature?) Feedback requested: How do you use tag hover descriptions for curating and do... Linked (https://stackoverflow.com/q/71823211?lq=1) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/71823211/interactive-debugger-for-inside-docker-container?noredirect=1&lq=1) Interactive debugger for inside docker container? (https://stackoverflow.com/q/68500344?lq=1) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/68500344/docker-running-node-exits-immediately-how-can-i-get-access?noredirect=1&lq=1) Docker running Node exits immediately, how can I get access? (https://stackoverflow.com/q/16296753?lq=1) (Question score (upvotes - downvotes)) 513 (https://stackoverflow.com/questions/16296753/can-you-run-gui-applications-in-a-linux-docker-container?noredirect=1&lq=1) Can you run GUI applications in a Linux Docker container? (https://stackoverflow.com/q/29599632?lq=1) (Question score (upvotes - downvotes)) 182 (https://stackoverflow.com/questions/29599632/container-is-not-running?noredirect=1&lq=1) Container is not running (https://stackoverflow.com/q/51121875?lq=1) (Question score (upvotes - downvotes)) 32 (https://stackoverflow.com/questions/51121875/how-to-run-docker-with-python-and-java?noredirect=1&lq=1) How to run Docker with python and Java? (https://stackoverflow.com/q/38786615?lq=1) (Question score (upvotes - downvotes)) 43 (https://stackoverflow.com/questions/38786615/docker-number-of-lines-in-terminal-changing-inside-docker?noredirect=1&lq=1) Docker number of lines in terminal changing inside docker (https://stackoverflow.com/q/50366848?lq=1) (Question score (upvotes - downvotes)) 34 (https://stackoverflow.com/questions/50366848/how-to-ssh-into-the-services-create-using-docker-compose?noredirect=1&lq=1) How to ssh into the services create using docker-compose (https://stackoverflow.com/q/51228904?lq=1) (Question score (upvotes - downvotes)) 20 (https://stackoverflow.com/questions/51228904/how-to-run-it-with-docker-compose?noredirect=1&lq=1) How to run -it with docker compose? (https://stackoverflow.com/q/41489816?lq=1) (Question score (upvotes - downvotes)) 14 (https://stackoverflow.com/questions/41489816/connect-sql-to-apache-nifi?noredirect=1&lq=1) connect SQL to apache nifi (https://stackoverflow.com/q/67924526?lq=1) (Question score (upvotes - downvotes)) 12 (https://stackoverflow.com/questions/67924526/how-to-get-back-to-shell-in-nodejslatest-docker-image?noredirect=1&lq=1) How to get back to shell in nodejs:latest docker image? (https://stackoverflow.com/questions/linked/30172605?lq=1) See more linked questions Related (https://stackoverflow.com/q/30090946?rq=3) (Question score (upvotes - downvotes)) 4 (https://stackoverflow.com/questions/30090946/how-to-enter-bash-of-an-ubuntu-docker-container?rq=3) How to enter bash of an ubuntu docker container? (https://stackoverflow.com/q/37093769?rq=3) (Question score (upvotes - downvotes)) 3 (https://stackoverflow.com/questions/37093769/docker-container-does-not-give-me-a-shell?rq=3) Docker container does not give me a shell (https://stackoverflow.com/q/43419500?rq=3) (Question score (upvotes - downvotes)) 46 (https://stackoverflow.com/questions/43419500/how-do-you-start-a-docker-ubuntu-container-into-bash?rq=3) How do you start a Docker-ubuntu container into bash? (https://stackoverflow.com/q/47038540?rq=3) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/47038540/how-to-get-into-an-active-docker-container?rq=3) How to get into an active docker container? (https://stackoverflow.com/q/53590406?rq=3) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/53590406/access-to-docker-shell-inside-one-of-containers?rq=3) access to docker shell inside one of containers (https://stackoverflow.com/q/58303450?rq=3) (Question score (upvotes - downvotes)) 20 (https://stackoverflow.com/questions/58303450/how-to-bash-into-a-docker-container?rq=3) How to bash into a docker container (https://stackoverflow.com/q/60515548?rq=3) (Question score (upvotes - downvotes)) 3 (https://stackoverflow.com/questions/60515548/how-to-get-an-interactive-bash-shell-in-a-docker-container?rq=3) How to get an interactive bash shell in a Docker container (https://stackoverflow.com/q/64833693?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/64833693/how-to-enter-docker-container-use-shell-script-and-do-something?rq=3) How to enter docker container use shell script and do something? (https://stackoverflow.com/q/67143463?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/67143463/how-to-get-into-docker-containers-shell-when-bash-is-not-available?rq=3) How to get into Docker container's shell when bash is not available? (https://stackoverflow.com/q/70616721?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/70616721/how-to-get-into-dart-docker-containers-shell?rq=3) How to get into Dart Docker container's shell? (https://stackexchange.com/questions?tab=hot) Hot Network Questions (Mathematics Stack Exchange) (https://math.stackexchange.com/questions/4964881/can-you-give-me-an-example-of-an-implicit-use-of-godels-completeness-theorem-s) Can you give me an example of an implicit use of Godel's Completeness Theorem, say for example in group theory? (Politics Stack Exchange) (https://politics.stackexchange.com/questions/88907/why-is-namibia-killing-game-animals-for-food-rather-than-allowing-more-big-game) Why is Namibia killing game animals for food rather than allowing more big game hunting? (Retrocomputing Stack Exchange) (https://retrocomputing.stackexchange.com/questions/30572/which-version-of-netscape-on-which-os-appears-in-the-movie-cut-2000) Which version of Netscape, on which OS, appears in the movie “Cut” (2000)? (MathOverflow) (https://mathoverflow.net/questions/477987/a-strange-lipschitz-function) A strange Lipschitz function (Space Exploration Stack Exchange) (https://space.stackexchange.com/questions/66796/how-much-time-would-an-astronaut-experience-accelerating-to-9999x-the-speed-of) How much time would an astronaut experience accelerating to .9999x the speed of light at an acceleration of 1G from the astronauts perspective? (Geographic Information Systems Stack Exchange) (https://gis.stackexchange.com/questions/485444/qgis-connect-to-the-mactiondigitizewithcurve-map-tool-toggled-signal) QGIS: Connect to the mActionDigitizeWithCurve map tool toggled signal (Worldbuilding Stack Exchange) (https://worldbuilding.stackexchange.com/questions/261344/world-building-knowledgebase-how-to-write-good-military-world-building) World Building Knowledgebase - How to write good Military World Building (Computer Science Stack Exchange) (https://cs.stackexchange.com/questions/169588/functor-composition-rule-necessary) Functor composition rule necessary? (Travel Stack Exchange) (https://travel.stackexchange.com/questions/191091/esta-is-not-letting-me-pay) ESTA is not letting me pay (Movies & TV Stack Exchange) (https://movies.stackexchange.com/questions/123329/70s-80s-animation-with-an-island-of-robots) 70s-80s animation with an island of robots (Biblical Hermeneutics Stack Exchange) (https://hermeneutics.stackexchange.com/questions/97561/which-mosaic-law-was-in-the-backdrop-of-ceremonial-hand-washing-in-mark-7) Which Mosaic law was in the backdrop of ceremonial hand-washing in Mark 7? (Worldbuilding Stack Exchange) (https://worldbuilding.stackexchange.com/questions/261316/how-much-easier-harder-would-it-be-to-colonize-space-if-humans-found-a-method-of) How much easier/harder would it be to colonize space if humans found a method of giving ourselves bodies that could survive in almost anything? (Physics Stack Exchange) (https://physics.stackexchange.com/questions/826367/what-counts-as-the-earths-mass-at-which-point-would-it-increase-or-decrease) What counts as the Earth's mass? At which point would it increase or decrease? (Space Exploration Stack Exchange) (https://space.stackexchange.com/questions/66787/if-starliner-returns-safely-on-autopilot-can-this-still-prove-that-its-safe-c) If Starliner returns safely on autopilot, can this still prove that it's safe? Could it be launched back up to the ISS again to complete its mission? (Android Enthusiasts Stack Exchange) (https://android.stackexchange.com/questions/258229/how-to-beep-in-termux) How to beep in Termux? (Travel Stack Exchange) (https://travel.stackexchange.com/questions/191096/overstayed-schengen-but-can-i-switch-to-us-passport) Overstayed Schengen but can I switch to US passport? (Academia Stack Exchange) (https://academia.stackexchange.com/questions/213261/journal-keeps-messing-with-my-proof) Journal keeps messing with my proof (Blender Stack Exchange) (https://blender.stackexchange.com/questions/323784/problem-with-closest-point-on-mesh-when-the-closest-point-is-on-an-edge) Problem with closest_point_on_mesh when the closest point is on an edge (German Language Stack Exchange) (https://german.stackexchange.com/questions/77882/can-you-use-sollen-the-same-way-as-should-in-sentences-about-possibility-tha) Can you use 'sollen' the same way as 'should' in sentences about possibility that something happens? (Cryptography Stack Exchange) (https://crypto.stackexchange.com/questions/112802/which-hash-algorithms-support-binary-input-of-arbitrary-bit-length) Which hash algorithms support binary input of arbitrary bit length? (Electrical Engineering Stack Exchange) (https://electronics.stackexchange.com/questions/724025/why-are-ic-and-ie-different-arent-the-two-1k-ohm-resistors-in-series-and-thus) Why are IC and IE different? Aren't the two 1k ohm resistors in series and thus the current through them should be the same? (Home Improvement Stack Exchange) (https://diy.stackexchange.com/questions/306257/my-20-amp-breaker-trips) My 20 amp breaker trips (Academia Stack Exchange) (https://academia.stackexchange.com/questions/213292/can-an-international-student-email-a-professor-at-a-foreign-university-for-an-in) Can an international student email a professor at a foreign university for an internship opportunity? (The Workplace Stack Exchange) (https://workplace.stackexchange.com/questions/198982/should-you-refactor-when-there-are-no-tests) Should you refactor when there are no tests? (/feeds/question/30172605) (Feed of this question and its answers) Question feed Subscribe to RSS Question feed To subscribe to this RSS feed, copy and paste this URL into your RSS reader. (https://stackoverflow.com/feeds/question/30172605) () (https://stackoverflow.com) (https://stackoverflow.com) Stack Overflow (/questions) Questions (/help) Help (https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com) Chat (https://stackoverflow.co/) Products (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams) Teams (https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising) Advertising (https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent) Talent (https://stackoverflow.co/) Company (https://stackoverflow.co/) About (https://stackoverflow.co/company/press/) Press (https://stackoverflow.co/company/work-here/) Work Here (https://stackoverflow.com/legal) Legal (https://stackoverflow.com/legal/privacy-policy) Privacy Policy (https://stackoverflow.com/legal/terms-of-service/public) Terms of Service (/contact) Contact Us Cookie Settings (https://stackoverflow.com/legal/cookie-policy) Cookie Policy (https://stackexchange.com) Stack Exchange Network (https://stackexchange.com/sites#technology) Technology (https://stackexchange.com/sites#culturerecreation) Culture & recreation (https://stackexchange.com/sites#lifearts) Life & arts (https://stackexchange.com/sites#science) Science (https://stackexchange.com/sites#professional) Professional (https://stackexchange.com/sites#business) Business (https://api.stackexchange.com/) API (https://data.stackexchange.com/) Data (https://stackoverflow.blog?blb=1) Blog (https://www.facebook.com/officialstackoverflow/) Facebook (https://twitter.com/stackoverflow) Twitter (https://linkedin.com/company/stack-overflow) LinkedIn (https://www.instagram.com/thestackoverflow) Instagram Site design / logo © 2024 Stack Exchange Inc; user contributions licensed under (https://stackoverflow.com/help/licensing) CC BY-SA . rev 2024.8.29.14628 By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our (https://stackoverflow.com/legal/cookie-policy) Cookie Policy . Accept all cookies Necessary cookies only Customize settings