nurdism/neko

[FEATURE] xfce desktop container

itskenny0 opened this issue · 7 comments

Could you add an xfce4 container that just starts a desktop with chromium installed?
I primarily get my chinese cartoons from nyaa, so I've hacked this together for now:

docker exec -it neko_neko_1 apt update
docker exec -it neko_neko_1 apt -y install xfce4 mpv qbittorrent
docker exec -it neko_neko_1 bash
sudo -u neko nohup xfce4-session &

This works great, but it would be much cleaner if a container was already available that does this.

@m1k1o I know, but I'm not that great with Docker and I would imagine that I'm not the only one with this use case, so an 'official' solution would be great :)

m1k1o commented

I'm not sure, that full remote desktop is the main use-case of this project, but this is one solution:

3files in 1folder:

Dockerfile

FROM nurdism/neko:base

#
# install xfce4
RUN set -eux; apt-get update; \
    apt-get install -y --no-install-recommends xfce4 firefox-esr mpv qbittorrent; \
    #
    # clean up
    apt-get clean -y; \
    rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#
# copy configuation files
COPY supervisord.conf /etc/neko/supervisord/xfce4.conf

supervisord.conf

[program:xfce4]
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s"
command=xfce4-session
autorestart=true
priority=800
user=%(ENV_USER)s
stdout_logfile=/var/log/neko/xfce4.log
stdout_logfile_maxbytes=100MB
stdout_logfile_backups=10
redirect_stderr=true
stderr_logfile=/var/log/neko/xfce4.err.log
stderr_logfile_maxbytes=100MB
stderr_logfile_backups=10

docker-compose.yml

  neko:
    build: .
    container_name: neko
    restart: unless-stopped
    shm_size: "1gb"
    environment:
      DISPLAY: :99.0
      NEKO_BIND: :8080
    ports:
      - 8080:8080
      - "59000-59100:59000-59100/udp"

And then run like nomal neko-container:

docker-compose up -d

Thank you! I did not realize you could start these from local with docker-compose.

I've made a few more adjustments and pushed my version: https://github.com/itskenny0/neko-xfce4

oh thats a neat idea, maybe I could make a nurdism/neko:xfce4 and a nurdism/neko:openbox docker image

not live yet but its done d451173