Odroid HC2 - Docker 23 - AppArmor issue

  • Hello,


    as others i also have an issue after the latest Docker update.


    I'm running an Odroid HC2:


    Code
    steakhutzeee@dk:~$ uname -a
    Linux dk 5.4.230-odroidxu4 #23.02.2 SMP PREEMPT Fri Feb 17 23:42:09 UTC 2023 armv7l GNU/Linux

    Docker is running but containers are not starting.


    If i try to manually start one i have:


    Code
    steakhutzeee@dk:~$ docker start heimdall
    Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: unable to apply apparmor profile: apparmor failed to apply profile: write /proc/self/attr/exec: no such file or directory: unknown
    Error: failed to start containers: heimdall

    I tried adding:


    extraargs=apparmor=0


    to my armbianEnv.txt and rebooted many times but nothing changes:


    Code
    steakhutzeee@dk:/boot$ cat armbianEnv.txt
    rootdev=UUID=9bb27981-aeac-4c2c-bb2d-95aa22509616
    rootfstype=ext4
    extraargs=apparmor=0
    usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u


    Tried uninstalling and reinstalling Docker from omv-extras tab but issue persists.


    My daemon.json file only contains:


    Code
    steakhutzeee@dk:/etc/docker$ sudo cat daemon.json
    {
    "data-root": "/srv/dev-disk-by-label-HC2/DockerBasePath/docker"
    }

    What should i do?


    Thank you in advance!

  • Run it as root or sudo

    It's the same:


    Code
    steakhutzeee@dk:~$ sudo docker start heimdall
    Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: unable to apply apparmor profile: apparmor failed to apply profile: write /proc/self/attr/exec: no such file or directory: unknown
    Error: failed to start containers: heimdall

    Also, my user is in the docker group.

  • apt purge apparmor

    steakhutzeee@dk:~$ sudo apt purge apparmor

    [sudo] password for steakhutzeee:

    Reading package lists... Done

    Building dependency tree... Done

    Reading state information... Done

    Package 'apparmor' is not installed, so not removed

    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

  • yes i know let it change at 0 we can still change it

    Ok, i did apt install apparmor apparmor-utils and restarted.

    Now containers are working again.


    I did also:


    Code
    steakhutzeee@dk:~$ systemctl status apparmor
    ● apparmor.service - Load AppArmor profiles
    Loaded: loaded (/lib/systemd/system/apparmor.service; enabled; vendor preset: enabled)
    Active: active (exited) since Tue 2023-02-28 18:15:48 CET; 3min 22s ago
    Docs: man:apparmor(7)
    https://gitlab.com/apparmor/apparmor/wikis/home/
    Process: 392 ExecStart=/lib/apparmor/apparmor.systemd reload (code=exited, status=0/SUCCESS)
    Main PID: 392 (code=exited, status=0/SUCCESS)
    CPU: 147ms

    So this is ok? It means that apparmor is installed but has been successfully disabled by extraargs=apparmor=0?


    If yes, why i had to install it in the first place?

    • Offizieller Beitrag

    So this is ok? It means that apparmor is installed but has been successfully disabled by extraargs=apparmor=0?


    If yes, why i had to install it in the first place?

    Yes. You have to have it installed because evidently docker doesn't recognize the apparmor is disabled at the OS level on arm systems (well, at least yours). So, it really just needs apparmor-utils but you can't install just that because it is dependent on the apparmor package.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • steakhutzeee

    Hat das Label gelöst hinzugefügt.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!