CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 00:53:24 GMT
server: Fly/6f91d33b9d (2025-10-08)
content-type: text/html; charset=utf-8
content-encoding: gzip
via: 2 fly.io, 2 fly.io
fly-request-id: 01K78C45P6FC6Y3CFEABXEFSZV-bom
Attaching a bash shell to a running Docker container | Simon Willison’s TILs
Attaching a bash shell to a running Docker container
Use docker ps
to find the container ID:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
81b2ad3194cb alexdebrie/livegrep-base:1 "/livegrep-github-re…" 2 minutes ago Up 2 minutes compassionate_yalow
Run docker exec -it ID bash
to start a bash session in that container:
$ docker exec -it 81b2ad3194cb bash
I made the mistake of using docker attach 81b2ad3194cb
first, which attaches you to the command running as CMD in that conatiner, and means that if you hit Ctrl+C
you exit that command and terminate the container!
Related
- docker Running gdb against a Python process in a running Docker container - 2021-03-21
- github-actions Talking to a PostgreSQL service container from inside a Docker container - 2020-09-18
- macos Running Docker on an M1 Mac - 2021-05-25
- cloudrun How to deploy a folder with a Dockerfile to Cloud Run - 2020-08-04
- docker Run pytest against a specific Python version using Docker - 2022-09-05
- docker Using pipenv and Docker - 2022-11-28
- github Running a Django and PostgreSQL development environment in GitHub Codespaces - 2023-08-10
- cloudrun Using build-arg variables with Cloud Run deployments - 2021-11-19
- bash nullglob in bash - 2022-02-14
- docker Installing packages from Debian unstable in a Docker image based on stable - 2021-03-22
Created 2020-08-10T08:41:01-07:00 · Edit