Git Product home page Git Product logo

xojo-docker's Introduction

Xojo on Docker

Docker images to run Xojo IDE and desktop apps. Images are hosted on Docker Hub.

Usage

Via X11 Forwarding

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. This is mandatory to connect to a TCP port for X11 forwarding from the container, as the port only binds to 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:

  • Make sure that xauth command is available on the Docker host when using SSH X11 forwarding.
  • SELinux may prevent accessing .Xauthority from inside Docker containers.
  • Containers launched using the docker command line above are volatile as --rm option is specified. Consider specifying additional volumes to keep your Xojo configuration and projects outside of the container. The IDE stores preferences (including licenses) under /root.
  • /opt/xojo/xojo is a symbolic link to the current Xojo root directory (e.g., /opt/xojo/xojo/xojo2019r2).
  • To install additional plugins you will need a custom Dockerfile based on xojo-VERSION image. Place plugin files (*.xojo_plugin) under /opt/xojo/xojo/Plugins/.

Headless Mode

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:

  • Use System.DebugLog method in Desktop apps to print to the standard output.
  • You can access the command line arguments via /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-Running Projects

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_

xojo-docker's People

Contributors

kmaehashi avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

xojo-docker's Issues

Package 'libwebkitgtk-3.0-0' has no installation candidate

Hi,
Thank you for this project :)

When I try to build the image, I got an error: Package 'libwebkitgtk-3.0-0' has no installation candidate

...
Get:39 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [386 kB]
Get:50 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [888 B]
Get:54 http://ftp.heanet.ie/pub/ubuntu focal-backports/main amd64 Packages [51.2 kB]
Get:59 http://ftp.heanet.ie/pub/ubuntu focal-backports/universe amd64 Packages [26.0 kB]
Get:61 http://ftp.heanet.ie/pub/ubuntu focal-backports/universe DEP-11 48x48 Icons [13.2 kB]
Get:55 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 DEP-11 Metadata [10.9 kB]
Get:56 http://archive.ubuntu.com/ubuntu focal-backports/main DEP-11 48x48 Icons [6961 B]
Get:57 http://archive.ubuntu.com/ubuntu focal-backports/main DEP-11 64x64 Icons [10.5 kB]
Get:58 http://archive.ubuntu.com/ubuntu focal-backports/main DEP-11 64x64@2 Icons [29 B]
Get:60 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [35.0 kB]
Get:62 http://archive.ubuntu.com/ubuntu focal-backports/universe DEP-11 64x64 Icons [22.6 kB]
Get:63 http://archive.ubuntu.com/ubuntu focal-backports/universe DEP-11 64x64@2 Icons [29 B]
Fetched 41.8 MB in 2s (18.9 MB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Package libwebkitgtk-3.0-0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libwebkitgtk-3.0-0' has no installation candidate
The command '/bin/sh -c apt-get -y update &&     apt-get -y install libc6 libncurses5 libstdc++6 libglib2.0-0 libsoup2.4-1 libgtk-3-0 libwebkitgtk-3.0-0 libunwind8 xvfb netcat-openbsd &&     rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*' returned a non-zero code: 100
make: *** [build] Error 100

Any idea ?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.