DEV Community

Cover image for How to use Binding Pry with a docker container
Danilo Costa
Danilo Costa

Posted on

3 2 1 1 2

How to use Binding Pry with a docker container

Hello fellas, today we're gonna solve an old noob problem, how to use Pry inside of a docker container?

It's simple, first you just need to add these two flags inside of your dockercompose file
app:
stdin_open: true
tty: true

Now, run your docker project with:
docker-compose up -d && docker attach $(docker-compose ps -q app)

And it's done

Top comments (2)

Collapse
 
cherryramatis profile image
Cherry Ramatis

Very nice tip!

Collapse
 
donmat_pl profile image
Mateusz Utkała

Nice tip! :) In VSCode you can use devcontainers to use it out-of-box without attach to container.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay