mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.62k stars 378 forks source link

dockerfile-x11docker-dde #18

Closed sikenali closed 6 years ago

sikenali commented 6 years ago

please add https://www.deepin.org/en/dde/

mviereck commented 6 years ago

I've already tried to, but I have some difficulties. Maybe you can help me. :-)

Currently, I try to use docker image deepin/deepin-core. But it seems I have a quite bad transfer rate, an apt-get update never finishes. I've looked at /etc/sources.list and tried to use different mirrors from Germany or USA. But all setups fail. The mirrors don't have a kui directory, and others like panda or trusty fail. Can you give me a working sources.list with a mirror in or near to Germany?

sikenali commented 6 years ago

@mviereck https://www.deepin.org/en/mirrors/packages/ Germany have four mirrors

sikenali commented 6 years ago

USA http://mirrors.kernel.org/deepin/

mviereck commented 6 years ago

Yeah, I've already tried some of these mirrors. The deepin docker image accesses kui in its sources.list. The mirrors don't have a kui directory, instead I find panda,precise and trusty. I tried to replace kuiwith panda,precise or trusty for the mirrors, but that does not work.

So I ask you for a sources.list that works in image deepin/deepin-core.

Currently, I am not able to build a deepin desktop image as the builds never finishes. I tried a build on docker hub with the original sources.list pointing to deepin.com, but after some hours, docker hub canceled the build.

mviereck commented 6 years ago

I did another try to use image debian:unstable as a base and to add http://mirrors.kernel.org/deepin/ to sources.list. But the built still fails:

FROM debian:unstable
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y gnupg && apt-get upgrade -y

RUN echo "deb http://mirrors.kernel.org/deepin unstable main non-free contrib" \
    > /etc/apt/sources.list.d/deepin.list
RUN echo "deb http://mirrors.kernel.org/debian unstable main non-free contrib" \
    > /etc/apt/sources.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 425956BB3E31DF51
RUN apt-get update

RUN apt-get install -y --no-install-recommends dde

Error message:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 dde : Depends: dde-desktop but it is not going to be installed
       Depends: dde-dock but it is not going to be installed
       Depends: dde-launcher but it is not going to be installed
       Depends: dde-control-center (> 2.90.5) but it is not going to be installed
       Depends: deepin-metacity but it is not going to be installed
       Depends: deepin-wm but it is not going to be installed
       Depends: startdde but it is not going to be installed
       Depends: dde-session-ui but it is not going to be installed
       Depends: deepin-appstore but it is not going to be installed
       Depends: deepin-notifications but it is not going to be installed
       Depends: deepin-manual but it is not going to be installed
       Depends: dde-file-manager but it is not going to be installed
       Depends: dde-qt5integration but it is not going to be installed
       Depends: dde-disk-mount-plugin but it is not going to be installed
       Depends: dde-trash-plugin but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
sikenali commented 6 years ago

@mviereck I feedback this problem to developers , thanks

deepinzhangshuang commented 6 years ago

only user "deb http://mirrors.kernel.org/deepin unstable main non-free contrib" to try, don't add "deb http://mirrors.kernel.org/debian unstable main non-free contrib".

mviereck commented 6 years ago

Thank you!

only user "deb http://mirrors.kernel.org/deepin unstable main non-free contrib" to try, don't add "deb http://mirrors.kernel.org/debian unstable main non-free contrib".

This did not work, too. But I found a working setup based on deepin/deepin-core using the panda branch, working with several mirrors tested so far:

FROM deepin/deepin-core

ENV DEBIAN_FRONTEND noninteractive

RUN echo "deb http://ftp.gwdg.de/pub/linux/linuxdeepin/deepin/ panda main non-free contrib" \
    > /etc/apt/sources.list

RUN apt-get update && apt-get upgrade -y

RUN apt-get install -y --no-install-recommends dde

# missing dependencies
RUN apt-get install -y dbus-x11 at-spi2-core gtk2-engines-murrine gtk2-engines-pixbuf && apt-get clean

# OpenGL support
RUN apt-get install -y mesa-utils mesa-utils-extra && apt-get clean

# additional utils
RUN apt-get install -y --no-install-recommends deepin-terminal gedit sudo && apt-get clean

# Hard way disabling bluetooth, "systemctl mask" does not work.
# Without bluetooth hardware this service eats up the CPU and spams the log.
RUN rm /lib/systemd/system/bluetooth.service /lib/systemd/system/bluetooth.target

# Mask failing units
RUN systemctl mask iptables.service systemd-tmpfiles-setup.service

# masking units not needed (does not seem to work for all of them)
RUN systemctl mask udisk2 upower NetworkManager bamfdaemon rtkit-daemon lastore-daemon.service lastore-update-metadata-info.service

ENV DEBIAN_FRONTEND newt

CMD startdde

I had to make some changes in x11docker itself to get it running. If you want to try out, please use current x11docker beta version: https://github.com/mviereck/x11docker/raw/experimental/x11docker

Core setup:

x11docker --desktop --systemd --sys-admin deepin

There are some issues in deepin if it does not find sound hardware. It runs pactl and dde-session-daemon with very high CPU usage making the system unusable. Though, I can set option --pulseaudio. Then the CPU calms down. But sound seems not to work well. Setup with pulseaudio:

x11docker --desktop --systemd --sys-admin --pulseaudio deepin

You can also add hardware acceleration:

x11docker --desktop --systemd --sys-admin --pulseaudio --gpu deepin

Do you have an idea about the CPU usage issue if running without option --pulseaudio? I tried to disable sound in the deepin config options, but that did not help.

For logfile output, add option --verbose.

mviereck commented 6 years ago

I have published a deepin desktop docker image!

Use it with the latest x11docker version (now V3.9.0.1):

x11docker --desktop --systemd --sys-admin --pulseaudio --gpu x11docker/deepin

Please check out if you find any issues. If you have a wish, maybe for additional applications, please tell me.

sikenali commented 6 years ago

@mviereck Thanks

mviereck commented 6 years ago

Since x11docker 3.9.0.5, you can drop insecure option --sys-admin and run deepin with:

x11docker --desktop --systemd --pulseaudio --gpu x11docker/deepin
mviereck commented 6 years ago

I found that x11docker/deepin had some issues making it quite slow. I fixed this with disabling some dbus services. It runs quite faster now. (Please update to latest x11docker for new x11docker/deepin).

Instead of option --systemd, you can use option --dbus-daemon, that speeds it up, too:

x11docker --desktop --dbus-daemon --pulseaudio --gpu x11docker/deepin

I've also added chinese fonts. Use --env LANG=zh_CN or just --env LANG=$LANG to get deepin in chinese.

mviereck commented 5 years ago

I had issues to build and run x11docker/deepin since April 2018. Now I succeeded with a fresh build. x11docker/deepin needs more privileges now to run.

Run desktop with:

x11docker --desktop --gpu --init=systemd --cap-default --hostipc -- --cap-add=SYS_RESOURCE --cap-add=IPC_LOCK -- x11docker/deepin

Note that this setup to run deepin desktop includes several options degrading container isolation. Do not use if security is a concern.