-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
Right now, we express three fundamentally different concepts:
- Image name, parent image name
- Image settings (which you might want to extend in a child folder)
- Run targets (default, build, etc)
The current format has the following problems:
- The per-target setting inheritance is confusing and overly clever.
- Worse, it conflates the default default run target with the default settings.
- Settings are loaded in an unintuitive manner; right now, in Boxen, most images can omit the build target's command... unless they change the default target's command. What?
- Placing the image's name in the default run target and the upstream/index image name in the build target is another strange facet.
- Surprising behaviour possible: specify different images in different targets; hilarity ensues.
... The list goes on. Basically, not a bad first draft, but let's scrap it and move on.
Current format:
#Settings inheritance is a complete mess
# Why is "default" holding settings and commands?
[default]
command = [ "/bin/echo", "Hello from docket!" ]
dns = [ "8.8.8.8", "8.8.4.4" ]
image = "docket.polydawn.net/ubuntu/12.04"
[bash]
command = [ "/bin/bash" ]
[build]
command = [ "/cwd/build.sh" ]
# Why is the image name mentioned in a target?
upstream = "index.docker.io/ubuntu/12.04"
index = "ubuntu:12.04"Proposed new format: only settings inherit.
# Hey, this section makes intuitive sense!
[image]
name = "docket.polydawn.net/ubuntu/12.04"
upstream = "index.docker.io/ubuntu/12.04"
index = "ubuntu:12.04"
# These apply to all targets, and all images in child folders.
[settings]
dns = [ "8.8.8.8", "8.8.4.4" ]
# Target settings do not apply to any other file - only this target, for this image.
[target.run] # Renamed default target to run, see #30
command = [ "/bin/echo", "Hello from docket!" ]
ports = [ "80", "80" ]
[target.bash]
command = [ "/bin/bash" ]
[target.build]
command = [ "/cwd/build.sh" ]
# This ports setting only applies to the build target!
ports = [ "80", "8080" ]Advantages: correct all the problems enumerated above, vastly simplified.
Disadvantages: lose some niche features like only specifying the bash target once.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels