Skip to content

modify lxc_template via JSON arguments #439

Closed

Description

@neomantra

The lxc-template should be made more customizable. One use case is to configure the various cgroup subsystems, for example cpusets. Since there is a HTTP/REST interface coming, it makes sense to express this in JSON and for it to be useable from the command line.

I'd like to be able to do this on the command line with a new -j option:

# Pin the "Hello word" to cpus 0,1
docker run -j '{ "cgroup": { "cpuset.cpus": "0,1" } }' ubuntu /bin/sh -c "while true; do echo Hello world; done"

Activity

  1. neomantra commented on Apr 24, 2013

    @neomantra
    ContributorAuthor

    #111 has some discussion of specifying volumes with JSON and could be folded with this.

  2. neomantra commented on Jun 3, 2013

    @neomantra
    ContributorAuthor

    So 0.4 has just come out with the RESTful Remote API. The JSON expressed here could be used in the POST request of container/(id)/start.

    Another use case for changing the lxc_template for advanced networking configuration. For instance, a given container may need to start with access to specific VLANs. This may change between different starts of the container.

  3. shykes commented on Aug 11, 2013

    @shykes
    Contributor

    There is an ongoing pull request for this. Adding to 0.6 to keep track.

  4. neomantra commented on Aug 21, 2013

    @neomantra
    ContributorAuthor

    @crosbymichael @shykes Hello, I'm coming up for air and able to revisit some of this work after Labor Day. I see pull request #1560, which achieves much of what this issue is about. I think it covers my specific use case.

    But, it doesn't use JSON but rather command line args. I had suggested JSON because of how it can work with a REST API.

    Shall I abandon this line of work? Or integrate JSON aspects once #1560 is accepted. Give me some guidance and I'll try to help out.

  5. crosbymichael commented on Aug 21, 2013

    @crosbymichael
    Contributor

    @neomantra The CLI takes the data from the command line and creates JSON requests to the REST Api. Everything supported on the CLI can be done directly via the REST Api.

  6. added a commit that references this issue on Feb 23, 2018
  7. added a commit that references this issue on Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions