From 561b6f9b787f0d01a3e40a55ce995c1473187876 Mon Sep 17 00:00:00 2001 From: WillScarlettOhara Date: Tue, 3 Sep 2024 19:07:59 +0200 Subject: [PATCH 1/2] Fix: Add missing dot in Docker build command --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 958ddea..5a477a5 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ CMD x11vnc -forever -usepw -create -shared ``` Build the docker image: ``` -docker build -f -t vnckoappimage +docker build -f -t vnckoappimage . ``` Using the modified docker image above, you can then run it headlessly, like so: ``` From 7e1ce7a23892db2a34e4489d93f1856a739eb234 Mon Sep 17 00:00:00 2001 From: WillScarlettOhara Date: Tue, 3 Sep 2024 22:50:38 +0200 Subject: [PATCH 2/2] Add some instruction to work on an updated KOReader image Added a few notes related to the difficulties I encountered. --- README.md | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a477a5..e0e905c 100644 --- a/README.md +++ b/README.md @@ -67,10 +67,45 @@ winpty docker exec -it vncko bash ``` From here, you can edit the frontend code. When you want to see your changes reflected, you can **Restart KOReader** from the emulator KOReader system menu. +### Updated KOReader +Allows you to work with a more recent version of KOReader. +``` +# Use Debian Bullseye as the base image +FROM debian:bullseye-slim +USER root + +# Update packages and install x11vnc, xvfb, SDL2, and other dependencies +RUN apt-get update && apt-get install -y \ + x11vnc \ + xvfb \ + libsdl2-2.0-0 \ + libutf8proc2 \ + libfontconfig1 \ + libfreetype6 + +# Set up the VNC password +RUN mkdir -p ~/.vnc && x11vnc -storepasswd 1234 ~/.vnc/passwd + +# Create the directory for KOReader +RUN mkdir -p /home/ko + +# Download and extract the KOReader AppImage into /home/ko +# Feel free to update the koreader version +ADD https://github.com/koreader/koreader/releases/download/v2024.07/koreader-appimage-x86_64-linux-gnu-v2024.07.AppImage /home/ko/appimage + +# Ensure the AppImage is executable and extract it +RUN chmod +x /home/ko/appimage && cd /home/ko && ./appimage --appimage-extract + +# Start the VNC server +CMD x11vnc -forever -usepw -create -shared +``` +The rest is as previously explained from "Build the Docker image:" + ### Notes * For some reason, if you close down the emulator after opening it then you lose keyboard focus in the xterm window * You need to prefix you `docker exec` in Windows with `winpty` for an interactive session to work +* You don't need `winpty` if you use powershell * The above steps were tested on Windows 10 with docker for desktop * You could mount in the front end code using `-v` if you extracted the AppImage files locally, todo: demonstrate this * You can of course `docker cp` your edited code out - +* Be cautious not to run the default VNC server that comes with some VNC softwares, as you may experience an infinite screen duplication effect of the host's display instead of what we want