Fix containerize view symlink issue (#39419)
This commit is contained in:
@@ -51,15 +51,17 @@ FROM {{ run.image }}
|
||||
|
||||
COPY --from=builder {{ paths.environment }} {{ paths.environment }}
|
||||
COPY --from=builder {{ paths.store }} {{ paths.store }}
|
||||
COPY --from=builder {{ paths.hidden_view }} {{ paths.hidden_view }}
|
||||
COPY --from=builder {{ paths.view }} {{ paths.view }}
|
||||
|
||||
# paths.view is a symlink, so copy the parent to avoid dereferencing and duplicating it
|
||||
COPY --from=builder {{ paths.view_parent }} {{ paths.view_parent }}
|
||||
|
||||
RUN { \
|
||||
echo '#!/bin/sh' \
|
||||
&& echo '.' {{ paths.environment }}/activate.sh \
|
||||
&& echo 'exec "$@"'; \
|
||||
} > /entrypoint.sh \
|
||||
&& chmod a+x /entrypoint.sh
|
||||
&& chmod a+x /entrypoint.sh \
|
||||
&& ln -s {{ paths.view }} {{ paths.former_view }}
|
||||
|
||||
{% block final_stage %}
|
||||
|
||||
|
@@ -47,7 +47,7 @@ EOF
|
||||
{% for application, help_text in apps.items() %}
|
||||
|
||||
%apprun {{ application }}
|
||||
exec /opt/view/bin/{{ application }} "$@"
|
||||
exec {{ paths.view }}/bin/{{ application }} "$@"
|
||||
|
||||
%apphelp {{ application }}
|
||||
{{help_text }}
|
||||
@@ -61,11 +61,14 @@ Stage: final
|
||||
%files from build
|
||||
{{ paths.environment }} /opt
|
||||
{{ paths.store }} /opt
|
||||
{{ paths.hidden_view }} /opt
|
||||
{{ paths.view }} /opt
|
||||
{{ paths.view_parent }} /opt
|
||||
{{ paths.environment }}/environment_modifications.sh {{ paths.environment }}/environment_modifications.sh
|
||||
|
||||
%post
|
||||
|
||||
# Symlink the old view location
|
||||
ln -s {{ paths.view }} {{ paths.former_view }}
|
||||
|
||||
{% block final_stage %}
|
||||
{% if os_packages_final.list %}
|
||||
# Update, install and cleanup of system packages needed at run-time
|
||||
|
Reference in New Issue
Block a user