Description
Cog does not always load images into docker after build. It sometimes does, though - but only if running on Apple Silicon:
https://github.com/replicate/cog/blob/main/pkg/docker/docker_command.go#L273
It's not entirely clear to me why Apple is special-cased here - it's actually to do with the build driver.
Docker's behaviour here depends on the build driver in use:
https://docs.docker.com/build/builders/drivers/
It looks like the intent of the code was to always load the image (the commend just above refers to an output type which actually isn't specified in the command), in which case Cog could always pass --load
, and/or specify the builder as the comment suggests.
However, it would also be helpful to just allow the user to pass extra arguments to the build command, and this would be a way of doing so. That would be helpful to me, building a CI pipeline. (Actually, I'd prefer Cog just to give me the dockerfile and let me do the build, but that's another discussion!)
I should be OK to create a PR for whatever is appropriate here.