简体   繁体   中英

Access rails console in aws docker container

I recently was given a project that is hosted in docker containers on AWS.

I do a lot of bugfixing where having access to rails console is super useful. For heroku projects, I run heroku run rails console . For AWS (non docker) I ssh in and run bundle exec rails console . I'm a docker noob so I don't know how to work with containers.

Is there any way I can access rails console in these containers?

Generally you can just attach to the docker container and run all the commands you want. The details depend a little on how the container is started initially.

sudo docker container ls should give you a good starting point though.

You can then attach to the container using docker attach... and run the commands you want. Another alternative is using docker exec on the container see here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM