Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build error (AppArmor) #16

Open
hermann-o opened this issue Nov 6, 2024 · 2 comments
Open

Docker build error (AppArmor) #16

hermann-o opened this issue Nov 6, 2024 · 2 comments

Comments

@hermann-o
Copy link

Docker build error (AppArmor)

Steps to reproduce

  • Provision DC4s_v3 VM in azure with Debian 12 or Ubuntu 24
  • Install as documented
  • run:
@t2:~$ scag-setup --bootstrap  --framework dotnet --project_dir t1
@t2:~$ ls t1/ 
hello_world.cs  hello_world.csproj  scag.toml

... setup looks good, but then ...

@t2:~$ **sudo sudo scag-build --project_dir t1**
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = "en_US.UTF-8",
	LC_CTYPE = "UTF-8",
	LANG = "C.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("C.UTF-8").
I: chroot architecture amd64 is equal to the host's architecture
I: finding correct signed-by value...
done
I: automatically chosen format: tar
I: using /tmp/mmdebstrap.XK3lBOHoPC as tempdir
I: running --setup-hook in shell: sh -c 'sh t1/.scag/mmdebstrap-hooks/setup.sh "$@"' exec /tmp/mmdebstrap.XK3lBOHoPC
I: running apt-get update...
done
I: downloading packages with apt...
done
I: extracting archives...
done
I: installing essential packages...
done
I: installing remaining packages inside the chroot...
done
done
I: running --customize-hook in shell: sh -c 'sh t1/.scag/mmdebstrap-hooks/customize.sh "$@"' exec /tmp/mmdebstrap.XK3lBOHoPC
I: cleaning package lists and apt cache...
done
done
I: creating tarball...
I: done
I: removing tempdir /tmp/mmdebstrap.XK3lBOHoPC...
I: success in 39.7357 seconds
Traceback (most recent call last):
  File "/usr/bin/scag-build", line 8, in <module>
    sys.exit(build())
             ^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/graminescaffolding/__main__.py", line 195, in build
    docker_id, docker_run_cmd = build_step(ctx, project_dir, conf)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/graminescaffolding/__main__.py", line 227, in build_step
    docker_id = builder.build()
                ^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/graminescaffolding/builder.py", line 236, in build
    image_unsigned = self.build_docker_image(
                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/graminescaffolding/builder.py", line 369, in build_docker_image
    image, _ = self.docker.images.build(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/docker/models/images.py", line 285, in build
    raise BuildError(chunk['error'], result_stream)
**docker.errors.BuildError: Could not check if docker-default AppArmor profile was loaded: open /sys/kernel/security/apparmor/profiles: no such file or directory** 

Expected results

docker container is complete

Actual results

docker fails

@woju
Copy link
Member

woju commented Nov 6, 2024

@oshogbo, can you look into it?

I found this: https://discuss.linuxcontainers.org/t/could-not-check-if-docker-default-apparmor-profile-was-loaded-open-sys-kernel-security-apparmor-profiles-permission-denied/6077, which suggests problem with nesting containers. But I don't have access to any azure machines, so I can't really reproduce.

@hermann-o
Copy link
Author

drop me a line in case you want access to the playground

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants