Run Xojo on Docker
Docker images to run Xojo IDE and desktop apps.
Images are hosted on Docker Hub.
First connect to a Linux host running Docker with SSH X11 forwarding enabled.
ssh -Y host
Then start the container to run Xojo IDE.
docker run \
--rm \
--net host \
--env DISPLAY \
--volume ~/.Xauthority:/root/.Xauthority \
kmaehashi/xojo-docker:xojo2022r11-ubuntu20.04
Notes:
--net host
: The container shares the same network namespace as the Docker host.localhost
of the Docker host.--env DISPLAY
: X11 applications (i.e., Xojo IDE) use this information to know the TCP port for X11 forwarding.--volume ~/.Xauthority:/root/.Xauthority
: X11 applications inside the container use this file as the authorization cookie to the forwarded X11 server.Remote Debugger can also be run inside the container.
docker run \
--rm \
--net host \
--env DISPLAY \
--volume ~/.Xauthority:/root/.Xauthority \
kmaehashi/xojo-docker:xojo2022r11-ubuntu20.04 \
"/opt/xojo/xojo/Extras/Remote Debugger Desktop/Remote Debugger Desktop 64-Bit/Remote Debugger Desktop"
To run your application instead of the IDE, specify the application path as an argument.
You can use desktop-runtime
image, which provides smaller footprint than xojo-{VERSION}
images.
docker run \
--rm \
--net host \
--env DISPLAY \
--volume ~/.Xauthority:/root/.Xauthority \
--volume /local/path/to/app_dir:/container/path/to/app_dir \
kmaehashi/xojo-desktop-runtime:ubuntu20.04 \
/container/path/to/app_dir/app
Hints:
xauth
command is available on the Docker host when using SSH X11 forwarding..Xauthority
from inside Docker containers.docker
command line above are volatile as --rm
option is specified./root
./opt/xojo/xojo
is a symbolic link to the current Xojo root directory (e.g., /opt/xojo/xojo/xojo2019r2
).xojo-VERSION
image.*.xojo_plugin
) under /opt/xojo/xojo/Plugins/
.You can run your desktop application in headless (no-display) mode for e.g. testing purposes or contiguous integration systems.
Before starting your application you need to source the headless
script, which internally configures a virtual X11 server (Xvfb
).
docker run \
--rm \
--volume /local/path/to/app_dir:/container/path/to/app_dir \
kmaehashi/xojo-desktop-runtime:ubuntu20.04 \
bash -c 'source /headless; /container/path/to/app_dir/app'
Hints:
System.DebugLog
method in Desktop apps to print to the standard output./proc/self/cmdline
, e.g.:
Public Function Arguments() as String()
Var ret() As String
#if TargetLinux And TargetDesktop
Var s As TextInputStream = TextInputStream.Open(New FolderItem("/proc/self/cmdline"))
Try
Var chunks() As String
While True
Var buf As String = s.Read(12)
If buf.Length = 0 Then Exit
chunks.Append(buf)
Wend
ret = String.FromArray(chunks, "").Split(Chr(0))
Finally
s.Close()
End Try
#endif
Return ret
End Function
Debug-run your application inside the Docker container, using the project source code and Xojo IDE.
cat _EOF_ | nc -U /tmp/XojoIDE
OpenFile("/path/to/project")
DoCommand("RunApp")
_EOF_