Kitematic: Feature Request: Export container settings to dockerfile

Created on 21 Dec 2017  路  8Comments  路  Source: docker/kitematic

I have a series of containers that I have set up and been using with Kitematic and would like to share them with my team. I'd love to send them a dockerfile with all the configurations that I currently have ready to go.

As far as I'm aware, I can't find a way to export the configurations of my containers in Kitematic to a Dockerfile. Is such a thing possible?

enhancement exproficient help wanted

Most helpful comment

Awesome. I would love to give this a shot later this week. I've been doing lots of work in react/redux lately, and this would be a great way for me to learn about electron and contribute to an open source project.

All 8 comments

There isn't such feature unfortunately - However, you can inspect the containers and save the JSON file provided. This will have the configuration you want.
If you can implement it, it'd be great to see this show up as a feature in Kitematic :P

Awesome. I would love to give this a shot later this week. I've been doing lots of work in react/redux lately, and this would be a great way for me to learn about electron and contribute to an open source project.

@agiron123 lmk if you're wanting some help, would be interested in helping out with the feature as well

Sure thing @glyif. I'd say the first thing that we need to do here is come up with a proposal on how we plan on tackling this issue and ask the maintainers if it's the right approach.

As mentioned above, @FrenchBen said that we can inspect the containers and save the JSON fie provided. Let's figure out how to do this first and then we can tackle turning this into something like a Dockerfile.

At the moment, I'm still getting familiar with the code, so any guidance here would be greatly appreciated.

@FrenchBen for clarification are you saying that kitematic has a feature that can save a container's configuration as a json? or are you saying that we can use docker inspect to get that json? If that's the case, it'll require a bit of reverse engineering to create a dockerfile from the docker inspect json. I'm not sure how effective that will be.

@glyif @agiron123 Yeah I guess we would have to inspect the container and then generate the Dockerfile from the JSON. Currently we are using dockerode https://github.com/docker/kitematic/blob/ec955fc6263e63c2d76e49dd06bf94c13e11095d/src/utils/DockerUtil.js#L53 We could therefore do something like

this.client.getContainer(CONTAINER_ID).inspect((err, data) => {
  if(!err){
     // generate Dockerfile from data
  }
}

@collin5 looking forward to your PR 馃尞

@FrenchBen Will create a PR for this soon 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jwschram picture jwschram  路  4Comments

foverzar picture foverzar  路  4Comments

matteo-bombelli picture matteo-bombelli  路  3Comments

rbq picture rbq  路  4Comments

djsowa picture djsowa  路  3Comments