无法在无根 docker 容器内运行 appimages

发布于 2025-01-18 21:40:12 字数 1204 浏览 4 评论 0原文

我已经在Ubuntu上安装了无根的Docker 20.04 [https://docs.docker.com/engine/security/security/rootless/] [1]

我有下载vscodium appimage,来自[https://github.com/vscodium/vscodium/vscodium/releleases/下载/1.66.0/vscodium-1.66.0-1648720116.glibc2.17-x86_64.appimage] [1]

  1. 我已经共享了带有无根docker容器的附属物的共享主机目录。但是它没有运行。当我手动安装(apt-get安装)在容器内部运行的容器内部任何GUI软件包(Ex。Firefox)。

  2. 命令的输出:docker-compose vscodium

    创建VScodium ...完成
    附着于VSCODIUM
    vscodium |代码:加载共享库时的错误:libnsss3.so:无法打开共享对象文件:没有此类文件或目录
    vScodium用代码127

    退出
  3. vScodium用代码127

    文件docker-compose.yml

    版本:“ 3”
    服务:

      vscodium:
     图片:Python:3.10.4-Bullseye
     入口点:custom-docker-entrypoint.sh
     container_name:vscodium
     环境:
        -  display = $ {display}
     卷:
        - /tmp/.x11-unix:/tmp/.x11-unix:ro
        -  $ home/.xauthority:$ home/.xauthority:ro
        -  ./custom-docker-entrypoint.sh:/usr/local/bin/custom-docker-entrypoint.sh
        -  ./appimages/vscodium.appimage:/ide/vscodium.appimage
     Network_mode:主机
     
  4. 文件的内容custom-docker-entrypoint.sh

    #!/bin/sh

    chmod a+x/ide/vscodium.appimage

    /ide/vscodium.Appimage -Appimage-tracktract-and-run

I have installed rootless docker on ubuntu 20.04 [https://docs.docker.com/engine/security/rootless/][1]

I have download vscodium appimage from [https://github.com/VSCodium/vscodium/releases/download/1.66.0/VSCodium-1.66.0-1648720116.glibc2.17-x86_64.AppImage][1]

  1. i have shared host directory containing this Appimage with rootless docker container. But it doesn't run. When I manually install(apt-get install) any GUI package(ex. firefox) inside the container it runs successfully.

  2. output of the command: docker-compose up vscodium

    Creating vscodium ... done
    Attaching to vscodium
    vscodium | codium: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
    vscodium exited with code 127

  3. content of file docker-compose.yml

    version: "3"
    services:

     vscodium:
     image: python:3.10.4-bullseye
     entrypoint: custom-docker-entrypoint.sh
     container_name: vscodium
     environment:
       - DISPLAY=${DISPLAY}
     volumes:
       - /tmp/.X11-unix:/tmp/.X11-unix:ro
       - $HOME/.Xauthority:$HOME/.Xauthority:ro
       - ./custom-docker-entrypoint.sh:/usr/local/bin/custom-docker-entrypoint.sh
       - ./appImages/VSCodium.AppImage:/ide/VSCodium.AppImage
     network_mode: host
    
  4. content of file custom-docker-entrypoint.sh

    #!/bin/sh

    chmod a+x /ide/VSCodium.AppImage

    /ide/VSCodium.AppImage --appimage-extract-and-run

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柠檬色的秋千 2025-01-25 21:40:12

关于在 docker 中运行 AppImages 的一些注意事项:

  • AppImages 需要熔断器才能运行,这通常在 docker 上不可用/不可用
  • 提取 AppImage 内容并将该文件夹挂载到
  • 缺少 libnss3.so 的 docker 上,您必须将其安装在主机系统上。如果它不起作用,您必须将其报告给 AppImage 作者,以便他们将其包含在捆绑包中。

A few notes on running AppImages insude docker:

  • AppImages require fuse to run which is usually not available/usable on docker
  • Extract the AppImage contents and mount that folder on your docker
  • missing libnss3.so, you will have to install this on the host system. If it doesn't work you will have to report it to the AppImage author to for them to include it in the bundle.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文