runs RED (and Rebol) scripts in a Docker Container (not only) on a modern Mac
RED (and Rebol) scripts do not run under macOS Catalina and newer since 32-bit applications are no longer supported.
If you still want to experiment with Rebol and/or RED, you will have to start a Docker container and either use a shell to run CLI scripts or use "X11 forwarding" for GUI scripts.
This repository basically contains a Dockerfile to build a Docker image for CLI and GUI scripts plus instructions for setting up a Mac in order to display RED/Rebol GUIs. The Dockerfile is based on a similar project, but has been modified to run all kinds of RED and Rebol scripts - additionally, the instructions to configure macOS have been modernized and simplified.
In order to build and run Docker images you must have Docker installed - for most people, installing the Docker Desktop is the best way to do so.
Then follow the steps shown below:
- clone this repository: either use
git clone https://github.com/rozek/docker-red
or download a ZIP archive with this repository and unpack it - navigate to the root folder of this repository:
cd docker-red
- build the Docker image using
docker build -t docker-red .
You are now ready to run CLI scripts. Simply start the container built before using
docker run --rm --platform=linux/386 -v .:/transfer -it docker-red
from the macOS Terminal and you will get a RED prompt.
If you prefer Rebol itself, just run
docker run --rm --platform=linux/386 -v .:/transfer -it docker-red /bin/rebol
instead.
The Docker image has been prepared to share a local (host) folder with the container - either for copying files into the container or vice-versa (or both).
Simply navigate to the local folder you want to share
cd <folder-shared-with-docker>
and run the Docker image as shown above.
Alternatively, you may also change the -v .:/transfer part of the Docker commands shown above to
-v <folder-shared-with-docker>:/transfer
and start the Docker container from anywhere.
MacOS cannot natively display GUIs created inside a Docker container - you need to install XQuartz for that purpose. Simply follow steps 1...7 from another guide but do not forget to restart your Mac!
You are now ready to run GUI scripts as well:
open -a XQuartz \
&& xhost +localhost \
&& docker run --rm --platform=linux/386 -v .:/transfer -e DISPLAY=host.docker.internal:0 \
-it docker-red /bin/red-view
starts red-view and
open -a XQuartz \
&& xhost +localhost \
&& docker run --rm --platform=linux/386 -v .:/transfer -e DISPLAY=host.docker.internal:0 \
-it docker-red /bin/rebol-view
does the same for Rebol and opens the famous Rebol Viewtop.
If you want to share a local folder with a Docker container running a GUI script, simply choose one of the approaches described above.