Skip to content

Index and Upstream should be mutually exclusive #34

@kofalt

Description

@kofalt

While #20 and #30 fixed the most glaring issues about configuration, one bit is still a little confusing: mixing the maintenance of two images into a single file.

Two operations are expressed in the same file with the upstream and index keys:

  1. Pulling an image down from the index and storing it in the graph
  2. Taking that stored image and mutating it

Instead, let's separate these into two files, each concerned with a single image.

Before:

[image]
    name     = "docket.polydawn.net/ubuntu/12.04"
    upstream = "index.docker.io/ubuntu/12.04"
    index    = "ubuntu:12.04"

After, ubuntu folder:

[image]
    name     = "docket.polydawn.net/ubuntu/12.04"
    upstream = "index.docker.io/ubuntu/12.04"

After, ubuntu-index folder:

[image]
    name     = "index.docker.io/ubuntu/12.04"
    index    = "ubuntu:12.04"

Docket should reject a configuration file that has both upstream and index keys. This carries the new restriction that an image can be sourced from an index, or a non-index source, but not both.

Hopefully, this restriction makes sense: you're either maintaining your own history of an image that came from an unversioned index, or you're not.

An advantage of this new split is we can now have build steps dedicated to maintaining index images! In the case of Ubuntu, this is rather pertinent: we can now clean out useless apt-get state from the index image before saving it to the graph, saving space. This is optional, but could be useful for performing tune-up on other people's index images.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions