Run gnome-shell in docker container

I want to run gnome in a docker container, but I get an error when I run gnome-shell.
The message is below。

root@295fba2bebf6:~# DISPLAY=:1 gnome-shell --x11
Xlib:  extension "DPMS" missing on display ":1".
Xlib:  extension "DPMS" missing on display ":1".

(gnome-shell:19530): Gjs-WARNING **: 05:14:42.392: Some code accessed the property 'CredentialManager' on the module 'credentialManager'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway.

(gnome-shell:19530): Gjs-WARNING **: 05:14:42.440: JS ERROR: Gio.IOErrorEnum: Could not connect: No such file or directory
get system@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:456:24
LoginManagerSystemd@resource:///org/gnome/shell/misc/loginManager.js:95:9
getLoginManager@resource:///org/gnome/shell/misc/loginManager.js:85:29
_init@resource:///org/gnome/shell/ui/background.js:257:41
getBackground@resource:///org/gnome/shell/ui/background.js:588:30
_createBackgroundActor@resource:///org/gnome/shell/ui/background.js:744:49
BackgroundManager@resource:///org/gnome/shell/ui/background.js:680:37
_createBackgroundManager@resource:///org/gnome/shell/ui/layout.js:448:25
_updateBackgrounds@resource:///org/gnome/shell/ui/layout.js:492:34
_monitorsChanged@resource:///org/gnome/shell/ui/layout.js:554:14
_init@resource:///org/gnome/shell/ui/layout.js:297:14
_initializeUI@resource:///org/gnome/shell/ui/main.js:180:21
start@resource:///org/gnome/shell/ui/main.js:146:5
@<main>:1:47

** Message: 05:14:42.440: Execution of main.js threw exception: Script <main> threw an exception

Who can tell me why this is.

I haven’t tried something like that in a while, but I think you need to bind the system bus into the container so it can talk to logind. Maybe try adding a switch like this to the docker run invocation:

-v /run/dbus:/run/dbus

Not sure if that will work though. Note this may also diminish the security of your docker container if it has access to the system bus.