Skip to content

Cog does not always load image into docker after build #2329

Open
@danfairs

Description

@danfairs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions