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

Allows to provide build-args to the Dockerfile build process #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

webmatze
Copy link

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. 😄

@collimarco
Copy link
Contributor

I was thinking about your example above and I wonder if you can use separate Cuberfiles and Dockerfiles 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

@webmatze
Copy link
Author

Sorry for replying so late.
Separate Cuber- and Dockerfiles is defenitely a way to go.

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

Successfully merging this pull request may close these issues.

2 participants