pub enum ImageSource {
Pull(String),
Build {
context: String,
dockerfile: String,
build_args: HashMap<String, String>,
target: Option<String>,
tag: String,
},
}Expand description
How the container image is obtained.
Produced during resolution and consumed by the runtime (to decide
whether to call docker pull or docker build) and by the export
pipeline (to emit the correct Compose image or build stanza).
§Example
use lightshuttle_spec::ImageSource;
use std::collections::HashMap;
// A pre-built image pulled from a registry.
let pulled = ImageSource::Pull("postgres:16-alpine".into());
// An image built locally from a Dockerfile.
let built = ImageSource::Build {
context: ".".into(),
dockerfile: "Dockerfile".into(),
build_args: HashMap::new(),
target: None,
tag: "lightshuttle/myproject_app:dev".into(),
};Variants§
Pull(String)
Pull the named image reference from a registry.
The inner String is a fully qualified image reference such as
postgres:16-alpine or ghcr.io/org/image:tag.
Build
Build the image locally from a Dockerfile.
The runtime calls docker build (or equivalent) with these
parameters before starting the container.
Fields
Trait Implementations§
Source§impl Clone for ImageSource
impl Clone for ImageSource
Source§fn clone(&self) -> ImageSource
fn clone(&self) -> ImageSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ImageSource
impl RefUnwindSafe for ImageSource
impl Send for ImageSource
impl Sync for ImageSource
impl Unpin for ImageSource
impl UnsafeUnpin for ImageSource
impl UnwindSafe for ImageSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more