StratusFearMe21/cargo-appimage

Running inside of container gives error

Closed this issue · 2 comments

When I run it in a container (podman or docker) I get the following error at the end of the build process:

fuse: device not found, try 'modprobe fuse' first
open dir error: No such file or directory

docker-compose:

version: "3"
services:
  rust-gtk-appimage:
    build: .
    volumes:
      - ../adwaita-demo:/mnt:z
    command: /bin/bash -c "cargo appimage"

Dockerfile:

FROM fedora:latest
ENV RUST_VERSION=1.58.1

RUN dnf install gtk4-devel gcc libadwaita-devel wget -y

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN . ~/.cargo/env
RUN ls $HOME/.cargo/env
ENV PATH=/root/.cargo/bin:$PATH
RUN rustup install ${RUST_VERSION}

RUN wget https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage
RUN chmod +x appimagetool-x86_64.AppImage
RUN mv appimagetool-x86_64.AppImage /usr/bin/appimagetool

WORKDIR /mnt
RUN cargo install cargo-appimage

CMD ["/bin/bash"]

Can you try building, but with docker run --privileged

I managed to fix it, there was a multitude of problems causing that.

  1. Not having file desktop-file-utils installed
  2. Docker not having a fuse filesystem therefore a need for setting ENV APPIMAGE_EXTRACT_AND_RUN=1 or extracting the appimage beforehand by doing: ./appimagetool-x86_64.AppImage --appimage-extract (and then linking the folder the appimage was extracted to ln -nfs /squashfs-root/usr/bin/appimagetool /usr/bin/appimagetool)

This is the corresponding Dockerfile (if anyone else encounters the problem): https://github.com/13hannes11/gtk4-rs-docker/blob/v1.58.1/appimage/Dockerfile