cuber-gem
cuber-gem copied to clipboard
Allows to provide build-args to the Dockerfile build process
I needed the ability to add build-args to the build process of the Dockerfile.
So I added it to the Cuberfile parser.
Example:
app 'test'
repo '.'
dockerfile 'Dockerfile'
dockerconfig 'config/dockerconfig.json'
image 'my/image-name'
buildarg 'RAILS_ENV', 'stage'
buildarg 'VERSION', 'v1.2.3'
proc :web, 'bundle exec rails s'
Maybe you'll find the useful or have any requests for changes.
Thank you anyhow for this amazing gem. 😄
I was thinking about your example above and I wonder if you can use separate Cuberfile
s and Dockerfile
s for each environment.
For example in a folder cuber/staging/Cuberfile
you will have the definition for the staging environment:
app 'test'
repo '.'
dockerfile 'Dockerfile.staging'
dockerconfig 'config/dockerconfig.json'
image 'my/image-name'
proc :web, 'bundle exec rails s'
Note that I use dockerfile 'Dockerfile.staging'
and I have removed the build args.
I suggest this because in different environments you will probably have many differences (different env variables, different scaling of resources, etc.). So using the same Cuberfile
for multiple environments would be difficult (too many conditions and subtle differences).
Let me know
Sorry for replying so late. Separate Cuber- and Dockerfiles is defenitely a way to go.