Skip to content

Issues with fuse when using AppImage tool in Docker container #405

@philippgille

Description

@philippgille

This might not be an issue with AppImage tool itself, but others might have trouble building an AppImage with Docker containers as well, so I thought I'd create an issue here. Mabe resolve this issue by extending documentation.

I'm trying to package a self-contained .Net Core console application as AppImage. On a Ubuntu 16.04 VM this works fine. But in a Docker container it doesn't.

The Docker container is microsoft/dotnet:1.1-sdk, which inherits from buildpack-deps:jessie-scm, which inherits from buildpack-deps:jessie-curl, which inherits from debian:jessie. The host is the aforementioned Ubuntu 16.04 VM.

I run AppImage tool from within a build script. The steps are:

# ...snip
# Copy SCD files
cp -r $ARTIFACTSDIR/${APPNAME}_ubuntu.16.04-x64 $SCRIPTDIR/../appimage/AppDir/usr/bin/
# Make sure AppRun is executable
chmod u+x $SCRIPTDIR/../appimage/AppDir/AppRun
# Download AppImage creation tool and make it executable
curl -Lo /tmp/appimagetool-x86_64.AppImage https://github.com/probonopd/AppImageKit/releases/download/8/appimagetool-x86_64.AppImage
chmod u+x /tmp/appimagetool-x86_64.AppImage
# Create AppImage
/tmp/appimagetool-x86_64.AppImage -u $SCRIPTDIR/../appimage/AppDir/ $ARTIFACTSDIR/${APPNAME}_ubuntu.16.04-x64.AppImage

This leads to the following output:

# ...snip
+ /tmp/appimagetool-x86_64.AppImage /root/scripts/../appimage/AppDir/ /root/scripts/../artifacts/hello-netcoreapp_ubuntu.16.04-x64.AppImage
/tmp/appimagetool-x86_64.AppImage: error while loading shared libraries: libfuse.so.2: cannot open shared object file: No such file or directory

After apt update && apt install -y libfuse-dev and running the build script again (all within the container):

# ...snip
+ /tmp/appimagetool-x86_64.AppImage /root/scripts/../appimage/AppDir/ /root/scripts/../artifacts/hello-netcoreapp_ubuntu.16.04-x64.AppImage
fuse: device not found, try 'modprobe fuse' first

Cannot mount AppImage, please check your FUSE setup.
You might still be able to extract the contents of this AppImage
if you run it with the --appimage-extract option.
See https://github.com/probonopd/AppImageKit/wiki/FUSE
for more information
open dir error: No such file or directory

For further info, within the container:

apt install kmod && modprobe fuse
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.57-std-1/modules.dep.bin'

I found this on StackOverflow: https://askubuntu.com/questions/459296/could-not-open-moddep-file-lib-modules-3-xx-generic-modules-dep-bin-when-mo

So with the changed package name I tried apt install --reinstall linux-image-3.16.0-4-amd64, but it didn't help (and probably is bogus to do in a container anyway?).

I also tried restarting the container after libfuse-dev installation, without the previous command, so within the newly created dotnet:1.1 container it was just apt update && apt install -y libfuse-dev && exit and then start the container again and run the build script. But it didn't help as well.

I then searched if I was doing anything wrong regarding the fuse installation and found this: https://stackoverflow.com/questions/24966347/is-s3fs-not-able-to-mount-inside-docker-container

Maybe some of those other packages needed to be installed. fuse-utils doesn't exist in the package repositories, but when searching with apt search fuse I found the fuse package and tried to install it. This lead to:

/var/lib/dpkg/info/fuse.postinst: 18: /var/lib/dpkg/info/fuse.postinst: lsmod: not found
MAKEDEV not installed, skipping device node creation.

And the build script didn't work yet, so within the container: apt purge fuse && apt install -y kmod makedev fuse

mv: cannot move 'console-' to 'console': Device or resource busy
makedev console c 5 1 root tty 0600: failed

There weren't many useful search results for that, except maybe https://bugs.launchpad.net/ubuntu/+source/makedev/+bug/927519, but that's specifically regarding a makedev upgrade, and also the bug was marked as fixed by the makedev developers.

Now I don't know what else to try.

Sooooo: Does anyone have any ideas or suggestions what to try next? Or maybe someone solved that issue already?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions