Skip to content

Commit

Permalink
Adding manifest-check during build stage
Browse files Browse the repository at this point in the history
Signed-off-by: Davis Benny <[email protected]>
  • Loading branch information
DukeDavis12 committed Nov 11, 2024
1 parent 1143bb6 commit c72dcdf
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions templates/Dockerfile.common.build.template
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ RUN chmod u+x /gramine/app_files/apploader.sh \
&& /usr/bin/python3 -B /gramine/app_files/finalize_manifest.py \
&& rm -f /gramine/app_files/finalize_manifest.py

RUN {% block path %}{% endblock %} gramine-manifest-check /gramine/app_files/entrypoint.manifest

# Define default command
ENTRYPOINT ["/bin/bash", "/gramine/app_files/apploader.sh"]
{% if insecure_args and cmd %}CMD {{ cmd | tojson }}{% endif %}
2 changes: 0 additions & 2 deletions templates/Dockerfile.common.sign.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ COPY gsc-signer-key.pem /gramine/app_files/gsc-signer-key.pem

ARG passphrase

RUN {% block path %}{% endblock %} gramine-manifest-check /gramine/app_files/entrypoint.manifest

RUN {% block path %}{% endblock %} gramine-sgx-sign \
--key /gramine/app_files/gsc-signer-key.pem \
--manifest /gramine/app_files/entrypoint.manifest \
Expand Down
2 changes: 2 additions & 0 deletions templates/centos/Dockerfile.build.template
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ RUN dnf install -y \
vim
{% endif %}
{% endblock %}

{% block path %}export PYTHONPATH="${PYTHONPATH}:$(find /gramine/meson_build_output/lib64 -type d -path '*/site-packages')" &&{% endblock %}
2 changes: 1 addition & 1 deletion templates/centos/entrypoint.manifest.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "entrypoint.common.manifest.template" %}

{% block loader %}
loader.entrypoint = "file:/gramine/meson_build_output/lib64/gramine/libsysdb.so"
loader.entrypoint.uri = "file:/gramine/meson_build_output/lib64/gramine/libsysdb.so"
loader.env.LD_LIBRARY_PATH = "/gramine/meson_build_output/lib64/gramine/runtime/glibc:/usr/lib64:{{"{{library_paths}}"}}"
{% endblock %}
2 changes: 2 additions & 0 deletions templates/debian/Dockerfile.build.template
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
{% endblock %}

{% block path %}export PYTHONPATH="${PYTHONPATH}:$(find /gramine/meson_build_output/lib -type d -path '*/site-packages')" &&{% endblock %}
2 changes: 1 addition & 1 deletion templates/debian/entrypoint.manifest.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "entrypoint.common.manifest.template" %}

{% block loader %}
loader.entrypoint = "file:/gramine/meson_build_output/lib/x86_64-linux-gnu/gramine/libsysdb.so"
loader.entrypoint.uri = "file:/gramine/meson_build_output/lib/x86_64-linux-gnu/gramine/libsysdb.so"

# Add "/usr/lib/x86_64-linux-gnu" explicitly because ldconfig in Ubuntu 21.04 doesn't
# produce it; note that this Debian template is used by Ubuntu templates as well
Expand Down
2 changes: 2 additions & 0 deletions templates/entrypoint.common.manifest.template
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ fs.root.uri = "file:/"

# Gramine's default working dir is '/', so change the working directory to the desired one
fs.start_dir = "{{working_dir}}"
fs.mounts = [
]

sgx.debug = {% if buildtype != "release" %} true {% else %} false {% endif %}

Expand Down
2 changes: 2 additions & 0 deletions templates/redhat/ubi-minimal/Dockerfile.build.template
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ RUN microdnf install -y \
strace
{% endif %}
{% endblock %}

{% block path %}export PYTHONPATH="${PYTHONPATH}:$(find /gramine/meson_build_output/lib64 -type d -path '*/site-packages')" &&{% endblock %}
2 changes: 2 additions & 0 deletions templates/redhat/ubi/Dockerfile.build.template
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ RUN dnf install -y \
strace
{% endif %}
{% endblock %}

{% block path %}export PYTHONPATH="${PYTHONPATH}:$(find /gramine/meson_build_output/lib64 -type d -path '*/site-packages')" &&{% endblock %}
2 changes: 2 additions & 0 deletions templates/suse/Dockerfile.build.template
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ RUN zypper install -y \
vim
{% endif %}
{% endblock %}

{% block path %}export PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}$(find /gramine/meson_build_output/lib64 -type d -path '*/site-packages')" &&{% endblock %}

0 comments on commit c72dcdf

Please sign in to comment.