'Error: No such container: tgd-api_redis_1

im trying to enter my redis container with this command :

docker container exec -it tgd-api_redis_1 /bin/sh

and this

docker exec -it tgd-api_redis_1 /bin/sh

but the result is error just like the title. i run docker ps to show what container I have, and the container i go to is there.

thanks in advance

enter image description here



Solution 1:[1]

Your container names are wrong.

Check stroke and underscore in your names!

Try the container id.

docker exec -it 6a0285dcd25b /bin/sh

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Blockchain Office