0

Currently I'm working on a pure Ruby application no Rails. When I try to use pry with Docker it gets stuck. I have success to get pry to work in Rails but not in a pure ruby application. When binding.pry is hit, I then go and run docker attach 1f8bc4aa4ac6 to attach to the container but still nothing is run.

[1] pry(LambdaFunctions::WebhookHandler)> form_fields

The dependencies are in the Gemfile, so I don't think I have to get a pry image, or do I? Here is my Dockerfile:

# Start with AWS lambda ruby environment
FROM lambci/lambda:build-ruby2.5

WORKDIR /var/task

# Install MySQL
RUN yum -y install mysql-devel

This is pry version I'm using in my Gemfile:

      gem 'pry', '~> 0.12.2'

This is the command I'm using for running the container:

 docker run --rm -v $(pwd):/var/task -e TENANCY="local" -e SUBMISSION_ID="{{submission_id}}" -t online-apps:latest bash scripts/webhook/formstack_webhook.sh
Steven Aguilar
  • 3,107
  • 5
  • 39
  • 89

1 Answers1

1

I needed to add -it to the docker command in order for it to work.

docker run --rm -v $(pwd):/var/task -e -it TENANCY="local" -e SUBMISSION_ID="{{submission_id}}" -t online-apps:latest bash scripts/webhook/formstack_webhook.sh
Steven Aguilar
  • 3,107
  • 5
  • 39
  • 89