Skip to content

base-image upload: add --from-file flag for local tar images#1855

Open
avdv wants to merge 2 commits into
namespacelabs:mainfrom
avdv:base-image-upload-from-file
Open

base-image upload: add --from-file flag for local tar images#1855
avdv wants to merge 2 commits into
namespacelabs:mainfrom
avdv:base-image-upload-from-file

Conversation

@avdv

@avdv avdv commented Jul 3, 2026

Copy link
Copy Markdown

Add a --from-file flag to nsc base-image upload that loads the source image from a local tar file (docker/podman save format) instead of pulling from a remote registry.

This is useful for images built locally with Podman or Nix that are not pushed to any registry:

podman save localhost/worker-image:latest -o worker-image.tar
nsc base-image upload --from-file worker-image.tar worker-image:latest

When --from-file is used, only the target tag argument is required (the source-image argument is omitted). Without --from-file, the original two-argument form is unchanged.

Add a --from-file flag to `nsc base-image upload` that loads the source
image from a local tar file (docker/podman save format) instead of
pulling from a remote registry.

This is useful for images built locally with Podman or Nix that are not
pushed to any registry:

  podman save localhost/worker-image:latest -o worker-image.tar
  nsc base-image upload --from-file worker-image.tar worker-image:latest

When --from-file is used, only the target tag argument is required (the
source-image argument is omitted). Without --from-file, the original
two-argument form is unchanged.
return err
}
default:
return fmt.Errorf("unsupported image type: %s", desc.MediaType)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Note, this switch statement was removed because it only worked for the Image case anyway (since makeAnnotations(ctx, desc, *annotateWithDigest) in the original code already called desc.Image() unconditionally which I think would return an error for indexes).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Disregard this, I looked a bit deeper and AFAIU this was working properly before. Adjusted to make it work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant