get inside a docker container
Open a shell in a running container, copy files in and out, read its logs, share a folder with it.
Steps
-
docker psthe running containers and their names
-
docker exec -it NAME sha shell inside it (bash, if the image has it)
-
docker logs -f NAMEits output, as it comes
-
docker cp NAME:/path/file ./copy a file out of it
-
docker run -it --rm -v "$PWD":/work -w /work ubuntu basha new container with this folder inside it
-
docker compose exec SERVICE shwith Compose, by service name
Commands used
docker
Each has a page in lore: lore docker opens it.