Skip to content

Commit

Permalink
Fix LD_LIBRARY_PATH in Ubuntu 21.04 Docker images
Browse files Browse the repository at this point in the history
Now GSC supports base Docker images with Ubuntu 18.04, 20.04 and 21.04.

Signed-off-by: Veena Saini <[email protected]>
  • Loading branch information
veenasai2 authored and Dmitrii Kuvaiskii committed Jan 7, 2022
1 parent 21b30f2 commit 634ef1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions finalize_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ def generate_library_paths():

# Library paths start without whitespace (in contrast to libraries found under this path)
ld_paths = (line for line in ld_paths if not re.match(r'(^\s)', line))

# ldconfig utility in Ubuntu 21.04 produces output lines like
# “/usr/local/lib: (from /etc/ld.so.conf.d/libc.conf:2)” – must take only the first part
# of this line (the actual path name)
ld_paths = ((line.split('(from')[0]).rstrip() for line in ld_paths)
return ''.join(ld_paths) + os.getenv('LD_LIBRARY_PATH', default='')


Expand Down
3 changes: 2 additions & 1 deletion templates/entrypoint.manifest.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
loader.entrypoint = "file:/gramine/meson_build_output/lib/x86_64-linux-gnu/gramine/libsysdb.so"
libos.entrypoint = "/{{binary}}"

loader.env.LD_LIBRARY_PATH = "/gramine/meson_build_output/lib/x86_64-linux-gnu/gramine/runtime/glibc:{{"{{library_paths}}"}}"
# ldconfig in Ubuntu 21.04 doesn't produce "/usr/lib/x86_64-linux-gnu" so add it explicitly
loader.env.LD_LIBRARY_PATH = "/gramine/meson_build_output/lib/x86_64-linux-gnu/gramine/runtime/glibc:/usr/lib/x86_64-linux-gnu:{{"{{library_paths}}"}}"
loader.env.PATH = "{{"{{env_path}}"}}"
loader.log_level = {% if debug %} "all" {% else %} "error" {% endif %}

Expand Down

0 comments on commit 634ef1a

Please sign in to comment.