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

nixos/docker-containers.nix: enhance functionality #78366

Merged
merged 8 commits into from Jan 28, 2020

Conversation

yorickvP
Copy link
Contributor

Motivation for this change
  • container cross-dependencies
  • using images from dockerTools
Things done
  • Ran in production

@yorickvP
Copy link
Contributor Author

See also: #64580

Copy link
Contributor

@mkaito mkaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've addressed my own change requests. Looks good to me now.

@DavHau
Copy link
Member

DavHau commented Jan 24, 2020

Thanks for this. That's exactly what i was looking for. The only thing that bugs me a bit about all the current image loading from file solutions, is that you always have to remember the name of the image in addition to the file. It would be amazing if it would be enough to only specify the file. Not sure if this can be implemented without extracting and repacking the whole image.

@mkaito
Copy link
Contributor

mkaito commented Jan 24, 2020

Not really. Docker wants the image to have a name. This is orthogonal from the whole loading process.

Copy link
Member

@nlewo nlewo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you enrich the test by adding a testcase for these features?

Another way to manage the image would be to use Skopeo since it is able to pull image from a registry as well as from local file. But we would have to change the interface of this module, and i'm not sure this is what we want ;)
For instance, instead of image, we could define these two options:

imageUrl = "docker://alpine"
imageName = "alpine"

or

imageUrl = "docker-archive://${dockerTools.buildImage {name...}}"
imageName = "myImage"

These attribute could then be used to build a Skopeo command:

skopeo copy ${imageUrl} docker-deamon://${imageName}

which loads a image to the local Docker deamon.

nixos/modules/virtualisation/docker-containers.nix Outdated Show resolved Hide resolved
nixos/modules/virtualisation/docker-containers.nix Outdated Show resolved Hide resolved
@mkaito
Copy link
Contributor

mkaito commented Jan 27, 2020

I definitely tried to keep the module interface stable. There are other concerns that I would probably like to address if we were to break the interface, but I don't have the time to rewrite the module right now.

@mkaito
Copy link
Contributor

mkaito commented Jan 27, 2020

I've modified the tests to use the new imageFile option.

@yorickvP
Copy link
Contributor Author

@GrahamcOfBorg test docker-containers

@nlewo
Copy link
Member

nlewo commented Jan 28, 2020

@GrahamcOfBorg test docker-containers

Copy link
Member

@nlewo nlewo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contributions ;)
I'm just waiting for the ofborg test to merge it!

@nlewo nlewo merged commit 5083439 into NixOS:master Jan 28, 2020
@nlewo
Copy link
Member

nlewo commented Jan 28, 2020

I finally ran the test on my laptop and it was green.

@yorickvP yorickvP deleted the mkaito/docker-containers branch January 29, 2020 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants