Docker exec. Container is not running. Dockerize rails -


i never user docker before. final goal - run chrome watir webdriver headlessly in ruby on rails app. honestly, new ror :)

i follow manual dockerize simple project using 'watir-webdriver' , 'headless' gems.

https://www.packet.net/blog/how-to-run-your-rails-app-on-docker/

my dockerfile

from ruby:latest  # mount shared volumes host container @ /share env home /home/rails/webapp  # install dependencies run apt-get update -qq && apt-get install -y build-essential libpq-dev  workdir $home  # install gems add gemfile* $home/ run bundle install  add . $home  cmd ["rails", "server", "--binding", "0.0.0.0"] 

steps made:

  1. create simple rails new watir-app postgresql support
  2. add gems watir-webdriver,headless , usage 1 controller.
  3. generate docker image docker build -t watir-app . (no errors)
  4. run container docker run -d -p 3000:3000 watir-app (no errors)
  5. the app not available on http://localhost:3000 trying connect container investigate:

    c:\users\ttttt\rubymineprojects\watir-test>docker ps -a

    container id image command created status ports names 868458c906c1 watir-app "rails server --bindi" 14 seconds ago exited (1) 11 seconds ago adoring_volhard

    c:\users\ttttt\rubymineprojects\watir-test>docker exec adoring_volhard echo "1" error response daemon: container 868458c906c13928040caf4a18d6395f6b020b3eb40a1d693de84c006b9a2617 not running

    c:\users\ttttt\rubymineprojects\watir-test>

ruby: 2.2.5

rails: 5.0.0.1

docker win: 1.12.0

discovered docker logs command, traced problem (needed install nodejs in container)


Comments