DEV Community

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

Posted on

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.