particle-os-cli/templates/Containerfile
gerblesh d90fbcbb5f
fix: remove deprecated bling COPY for files and rpms (#52)
https://github.com/ublue-os/bling/blob/main/Containerfile the
containerfile copies an empty folder in these locations for backwards
compatability. `/tmp/files` and `/tmp/rpms` have been deprecated from
bling, all of the RPMs have mostly moved to COPR or ublue-os/config

Co-authored-by: Gerald Pinder <gmpinder@gmail.com>
2024-02-07 20:51:53 -05:00

72 lines
2.4 KiB
Docker

FROM {{ recipe.base_image }}:{{ recipe.image_version }}
LABEL org.opencontainers.image.title="{{ recipe.name }}"
LABEL org.opencontainers.image.description="{{ recipe.description }}"
LABEL io.artifacthub.package.readme-url=https://raw.githubusercontent.com/ublue-os/startingpoint/main/README.md
LABEL io.artifacthub.package.logo-url=https://avatars.githubusercontent.com/u/120078124?s=200&v=4
ARG RECIPE={{ recipe_path.display() }}
{%- if let Some(repo_owner) = self::get_github_repo_owner() %}
ARG IMAGE_REGISTRY=ghcr.io/{{ repo_owner }}
{%- else if let Some(registry) = self::get_gitlab_registry_path() %}
ARG IMAGE_REGISTRY={{ registry }}
{%- else %}
ARG IMAGE_REGISTRY=localhost
{%- endif %}
{%- if self::has_cosign_file() %}
COPY cosign.pub /usr/share/ublue-os/cosign.pub
{%- endif %}
COPY --from=docker.io/mikefarah/yq /usr/bin/yq /usr/bin/yq
COPY --from=gcr.io/projectsigstore/cosign /ko-app/cosign /usr/bin/cosign
COPY --from=ghcr.io/blue-build/cli:
{%- if let Some(tag) = recipe.blue_build_tag -%}
{{ tag }}
{%- else -%}
latest-installer
{%- endif %} /out/bluebuild /usr/bin/bluebuild
COPY config /tmp/config/
# Copy modules
# The default modules are inside ublue-os/bling
COPY --from=ghcr.io/ublue-os/bling:latest /modules /tmp/modules/
# Custom modules overwrite defaults
COPY modules /tmp/modules/
RUN printf {{ self::print_script(export_script) }} >> /tmp/exports.sh && chmod +x /tmp/exports.sh
ARG CONFIG_DIRECTORY="/tmp/config"
ARG IMAGE_NAME="{{ recipe.name }}"
ARG BASE_IMAGE="{{ recipe.base_image }}"
{%- for module in recipe.modules_ext.modules %}
{%- if let Some(type) = module.module_type %}
{%- if type == "containerfile" %}
{%- if let Some(containerfiles) = self::get_containerfile_list(module) %}
{%- for c in containerfiles %}
{{ self::print_containerfile(c) }}
{%- endfor %}
{%- endif %}
{%- if let Some(snippets) = self::get_containerfile_snippets(module) %}
{%- for s in snippets %}
{{ s }}
{%- endfor %}
{%- endif %}
{%- else if type == "files" %}
{%- if let Some(files) = self::get_files_list(module) %}
{%- for (src, dest) in files %}
COPY {{ src }} {{ dest }}
{%- endfor %}
{%- endif %}
{%- else %}
RUN chmod +x /tmp/modules/{{ type }}/{{ type }}.sh && source /tmp/exports.sh && /tmp/modules/{{ type }}/{{ type }}.sh '{{ self::print_module_context(module) }}'
{%- endif %}
{%- endif %}
{%- endfor %}
RUN rm -rf /tmp/* /var/* && ostree container commit