hercules-ci / arion

Run docker-compose with help from Nix/NixOS
Apache License 2.0
667 stars 48 forks source link

NixOS module causes image not found #147

Closed ThinkChaos closed 2 years ago

ThinkChaos commented 2 years ago

With the current code I'm getting an error about the arion generated image not being found. Here's the log for the webserver example:

ERROR: for webserver  Cannot create container for service webserver: No such image: docker.io/library/webserver:bwvdlgd6q9ld1vzpd8xgdy2963bfkg1d: image not known

Set services.webserver.build.imageName = lib.mkForce "localhost/webserver"; fixes the issue. I think the fix would be to add the localhost/ prefix in src/nix/modules/service/image.nix. There might be a better approach I missed since this is the first time I'm looking at arion's code.

aanderse commented 2 years ago

@ThinkChaos are you able to create a PR and we can have @roberth review?

roberth commented 2 years ago

There might be a better approach

I was thinking we could change the default of services.<name>.image.name.

Do you happen to know why this has become necessary? It seems that podman has changed.

It might be a bit of a breaking change, so we could use some sort of rationale.

I've also created https://github.com/hercules-ci/arion/pull/148 in the meanwhile, which is running into the same issue. Don't know if the fix to this problem needs the rest of the update, so fyi.

ThinkChaos commented 2 years ago

Do you happen to know why this has become necessary?

It sounds like something changed the default registry to docker.io. I don't have access to a computer at the moment so not too sure what, but it seems the NixOS default configuring registries has docker.io as the main one since 2 years. Maybe a podman module change made it active, or a podmand code change?

Anyways adding localhost/ explicit in the default sounds like a good thing to me.

roberth commented 2 years ago

Done in #148.

It might be a bit of a breaking change

Realistically, I don't think anyone depends on the name, as it's an implementation detail when considering the "normal" use cases and what's documented. Famous last words of course ;) but the choice is between "move fast and break things" or stagnation. If it's more breaking than I expected, I'll be happy to take a test case for your use case. (And that's in general)

aanderse commented 2 years ago

Thanks!