If you want to do it in multiple, easy-to-remember commands:
docker ps -a
docker start -i <name/id>
The -i
flag tells docker to attach to the container's stdin.
If the container wasn't started with an interactive shell to connect to, you need to do this to run a shell:
docker start <name/id>
docker exec -it <name/id> /bin/sh
The /bin/sh
is the shell usually available with alpine-based images.