ledermann/docker-rails-base

Set ENV var before bundling for gems like sidekiq-pro

weilandia opened this issue · 3 comments

Is there a way to pass ENV vars to the container before bundling?

Interesting question. This should work via mounting secrets like the existing .npmrc/.yarnrc handling. Will try this later...

I've just made a change to the Builder Dockerfile. If your Sidekiq credentials are included in your ~/.bundle/config file, you can inject this file via secret:

docker buildx build --secret id=bundleconfig,src=$HOME/.bundle/config .

@weilandia Does this help?

This helps! Thanks @ledermann