5

I've tried a fresh install of Ubuntu (release 20.04) on my cloud server and then tried to install docker and run the setup based on information from Ubuntu's Official Page.

When I reach the step for testing with "Hello World"by running:

sudo docker run hello-world

I would get the following error:

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.
ERRO[0000] error waiting for container:

I'd like to be able to run docker on my instance.

1 Answer 1

5

The error message gives little bits of clues, but most importantly says it has a problem with apparmor. Checking my version of app armor using the command: aa-status produced a not found message indicating that it was not installed on my OS. I installed apparmor with the command:

sudo apt install apparmor

Subsequentally, I ran the docker hello world again:

sudo docker run hello-world

It was able to run and produce the correct output.

5
  • 1
    One has to wonder why AppArmor wasn't installed in the first place - I don't know if this is normal for cloud images? Feb 19, 2023 at 21:42
  • 1
    It's a dependency of snapd, perhaps @avogadro removed it?
    – popey
    Feb 20, 2023 at 1:26
  • @ArturMeinild / @popey : I'm using a hosting service from HostWinds using their 'Unmanaged SSD Cloud 3' service using their Ubunutu 20.04 install. After testing for snapd, it is not installed for some reason. I'm wondering if Hostwinds modified the Ubuntu image to be as slim as possible?
    – Avogadro
    Feb 20, 2023 at 11:00
  • I would like to improve 'why' I got this error. Hostwinds confirmed that they do use the standard Ubuntu server image for installs. As a test, I tried to pull the latest Ubuntu docker image and run it to try out snapd. Both apparmor and snap are not installed. I cannot find documentation that says these shouldn't be installed, so I'm starting to go down a rabbit hole here.
    – Avogadro
    Feb 20, 2023 at 11:16
  • 2
    My system needed a reboot after installing apparmor.
    – Eneko
    Feb 27, 2023 at 11:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .