Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker absolute volume path and runtime error #58

Closed
pun-ky opened this issue Dec 10, 2019 · 8 comments
Closed

Docker absolute volume path and runtime error #58

pun-ky opened this issue Dec 10, 2019 · 8 comments

Comments

@pun-ky
Copy link

pun-ky commented Dec 10, 2019

docker run --name=example_iridakos.duckrails.release-v2.1.5 -v=/Users/krystian.panek/Projects/gradle-aem-multi/duckrails:/opt/duckrails/db -p=8080:80 --rm iridakos/duckrails:release-v2.1.5
WARNING: Environment variable SECRET_KEY_BASE has not been set - Setting a random SECRET_KEY_BASE
rake aborted!
ActiveRecord::StatementInvalid: Could not find table 'mocks'
/opt/duckrails/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/sqlite3_adapter.rb:501:in `table_structure'
/opt/duckrails/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/sqlite3_adapter.rb:375:in `columns'
/opt/duckrails/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/schema_cache.rb:43:in `columns'
/opt/duckrails/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/attributes.rb:93:in `columns'
/opt/duckrails/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/attributes.rb:98:in `columns_hash'
/opt/duckrails/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/relation/delegation.rb:48:in `columns_hash'

but when I use just duckrails on the left side of volume it works.

docker run --name=example_iridakos.duckrails.release-v2.1.5 -v=duckrails:/opt/duckrails/db -p=8080:80 --rm iridakos/duckrails:release-v2.1.5

still when using absolute path or relative path, in both cases seems that volume is working / file duckrails/production.sqlite3 is created... so that seems that is is something wrong later on DuckRails runtime side.

this is blocking me in case of using Duckrails on Windows on which I need to support Docker Toolbox in which absolute volume paths usage is essential.

it would be nice to have it fixed :)

greetings, Krystian

@pun-ky
Copy link
Author

pun-ky commented Dec 10, 2019

also does not work when using Swarm :/

image

@pun-ky
Copy link
Author

pun-ky commented Dec 10, 2019

is there any chance to have it fixed within next days? sorry I have no Ruby knowledge to be able to fix it by myself :/

@pun-ky
Copy link
Author

pun-ky commented Jan 14, 2020

any volunteers to help with that? :)

@ChristianHeimke
Copy link

@pun-ky

I just stumbled over your issue, maybe you found the answer finally ;-) If not, this will maybe help you out:

You're calling docker with the wrong parameters:

# wrong
docker run --name=example_iridakos.duckrails.release-v2.1.5 -v=/Users/krystian.panek/Projects/gradle-aem-multi/duckrails:/opt/duckrails/db -p=8080:80 --rm iridakos/duckrails:release-v2.1.5

# right
docker run --name=example_iridakos.duckrails.release-v2.1.5 -v /Users/krystian.panek/Projects/gradle-aem-multi/duckrails:/opt/duckrails/db -p 8080:80 --rm iridakos/duckrails:release-v2.1.5

What's the diff? You shouldn't use = on short params like -p or -v. If you want to use it, you need to pass the double dash and the "full wording", e.g. --volume=... or --port=...

Maybe this will help :) I just tested the command from the docs:

docker run -p 8080:80 -v duckrails:/opt/duckrails/db iridakos/duckrails:latest

and it worked out of the box.

@pun-ky
Copy link
Author

pun-ky commented Aug 3, 2020

maybe... but I tested/repeated error when configuring container in compose file where these quotes don't matter.
how about that? @ChristianHeimke #58 (comment)

@ChristianHeimke
Copy link

yes, you're right.

I'm just guessing, but maybe it's related to the docker-entrypoint.sh, which will bootstrap the database and tables. maybe you can check out the difference of your file and the provided compose files:

I've tested the first one and it worked as expected. Maybe.. it is also related to the 2.1.5 version - I've not tested this specific one, just the lastest and the compose file with building the current source.

@pun-ky
Copy link
Author

pun-ky commented Aug 7, 2020

Good point, I will do that. @ChristianHeimke thx

@pun-ky
Copy link
Author

pun-ky commented Aug 7, 2020

I guess it could be somehow addressed by providing correct docker compose file so does not affect directly Duckrails app.

@pun-ky pun-ky closed this as completed Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants