You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple app built with Ruby on Rails and deployed to cloud.gov via docker image runs fine, but cf run-tasks and cf ssh do not work without workarounds.
Context
It appears that the PATH gets messed up for cf run-tasks and cf ssh while the actual running app is fine. On an example app:
cf run-tasks cf-test "bundle exec rake db:migrate" fails, but
works. The same PATH exporting and bundle check dance is required to run commands after using cf ssh APP_NAME
On further testing today, run-task might only require prepending the cd /usr/src/app (that path being the WORKDIR of the docker image) part to correctly run, though cf ssh requires the full setup before commands start being found.
Tasks such as bundle exec rake db:migrate:status complete successfully.
Current result
Tasks such as bundle exec rake db:migrate:status fail with logs:
2019-06-14T09:09:24.14-0400 [APP/TASK/f180fd00/0] ERR Could not locate Gemfile or .bundle/ directory
2019-06-14T09:09:24.17-0400 [APP/TASK/f180fd00/0] OUT Exit status 10
Commands such as bundle exec rake db:migrate:status when run after sshing to app fail with:
root@f153f6fd-97a9-47ab-4a36-e9c8:/usr/src/app# bundle exec rake db:migrate:status
bash: bundle: command not found
The text was updated successfully, but these errors were encountered:
start a "sidecar" server in the entrypoint as port ":9999" which responds with the environment it has and then when executing the task or ssh eval $(curl localhost:999)
Issue
A simple app built with Ruby on Rails and deployed to cloud.gov via docker image runs fine, but
cf run-tasks
andcf ssh
do not work without workarounds.Context
It appears that the
PATH
gets messed up forcf run-tasks
andcf ssh
while the actual running app is fine. On an example app:cf run-tasks cf-test "bundle exec rake db:migrate"
fails, butworks. The same
PATH
exporting andbundle check
dance is required to run commands after usingcf ssh APP_NAME
On further testing today,
run-task
might only require prepending thecd /usr/src/app
(that path being theWORKDIR
of the docker image) part to correctly run, thoughcf ssh
requires the full setup before commands start being found.Steps to Reproduce
A reproducing example app is at https://github.com/rahearn/cf-docker-test
The full docker build command used was:
Expected result
Tasks such as
bundle exec rake db:migrate:status
complete successfully.Current result
Tasks such as
bundle exec rake db:migrate:status
fail with logs:Commands such as
bundle exec rake db:migrate:status
when run after sshing to app fail with:The text was updated successfully, but these errors were encountered: