feat: Allow user to use source images (#69)
This commit is contained in:
parent
369fbab03f
commit
93b40f8d73
2 changed files with 8 additions and 0 deletions
|
|
@ -245,6 +245,10 @@ pub struct Module<'a> {
|
||||||
#[serde(rename = "from-file", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "from-file", skip_serializing_if = "Option::is_none")]
|
||||||
pub from_file: Option<Cow<'a, str>>,
|
pub from_file: Option<Cow<'a, str>>,
|
||||||
|
|
||||||
|
#[builder(default, setter(into, strip_option))]
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub source: Option<Cow<'a, str>>,
|
||||||
|
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
#[builder(default, setter(into))]
|
#[builder(default, setter(into))]
|
||||||
pub config: IndexMap<String, Value>,
|
pub config: IndexMap<String, Value>,
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,11 @@ RUN \
|
||||||
--mount=type=tmpfs,target=/tmp \
|
--mount=type=tmpfs,target=/tmp \
|
||||||
--mount=type=tmpfs,target=/var \
|
--mount=type=tmpfs,target=/var \
|
||||||
--mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw \
|
--mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw \
|
||||||
|
{%- if let Some(source) = module.source %}
|
||||||
|
--mount=type=bind,from={{ source }},src=/modules,dst=/tmp/modules,rw \
|
||||||
|
{%- else %}
|
||||||
--mount=type=bind,from=stage-modules,src=/modules,dst=/tmp/modules,rw \
|
--mount=type=bind,from=stage-modules,src=/modules,dst=/tmp/modules,rw \
|
||||||
|
{%- endif %}
|
||||||
--mount=type=bind,from=stage-exports,src=/exports.sh,dst=/tmp/exports.sh \
|
--mount=type=bind,from=stage-exports,src=/exports.sh,dst=/tmp/exports.sh \
|
||||||
chmod +x /tmp/modules/{{ type }}/{{ type }}.sh \
|
chmod +x /tmp/modules/{{ type }}/{{ type }}.sh \
|
||||||
&& source /tmp/exports.sh && /tmp/modules/{{ type }}/{{ type }}.sh '{{ self::print_module_context(module) }}'
|
&& source /tmp/exports.sh && /tmp/modules/{{ type }}/{{ type }}.sh '{{ self::print_module_context(module) }}'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue