node.jsdockerdokku

Unable to push code to fresh Dokku container: unable to apply apparmor profile: apparmor failed to apply profile


On my server I installed dokku and created a new App: myNodeApp

$ dokku apps:create myNodeApp

On my local repo I added the dokku remote and want now to push the existing code to my container, after git add . :

$ git push dokku main
Enumerating objects: 1119, done.
Counting objects: 100% (1119/1119), done.
Delta compression using up to 20 threads
Compressing objects: 100% (760/760), done.
Writing objects: 100% (1119/1119), 92.80 MiB | 11.25 MiB/s, done.
Total 1119 (delta 577), reused 727 (delta 310), pack-reused 0
remote: Resolving deltas: 100% (577/577), done.
-----> Set main to DOKKU_DEPLOY_BRANCH.
-----> Cleaning up...
-----> Building myNodeApp from herokuish
remote: time="2023-02-18T21:02:28Z" level=error msg="error waiting for container: "
remote: docker: 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/apparmor/exec: no such file or directory: unknown.
remote:  !     Failure extracting app code
remote:  !     Removing invalid image tag dokku/myNodeApp:latest
remote:  !     App build failed
To serversIP:myNodeApp
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'serversIP:myNodeApp'
(base)

Solution

  • This is a Docker issue. Docker v23 accidentally added a hard dependency on AppArmor, and v23.0.1 implemented an incorrect fix, changing the error message to the one you encountered.

    For the moment, the fix is one of:

    a) Downgrade Docker to below v23

    b) Install the apparmor package (I also had to reboot)

    c) The issue for the new error has been closed and is marked to go out in v23.0.2.