Run the following in your shell on Linux or macOS,
docker run -dp 80:80 dtcooper/tuxracer-web && sleep 2 && python -m webbrowser http://localhost/
ZOMG! Holy moly! It’s Tux Racer! What great fun! This is dumb! Yes it is! I like exclamation marks? Probably! Okay?
Wow! Now you can run Extreme Tux Racer in a Docker container, playing it in your web browser using noVNC over a VNC-to-websocket bridge.
Why? Because you can. ¯\_(ツ)_/¯
Make sure you have Docker installed, then run the
container exposing port 80
,
docker run -p 80:80 dtcooper/tuxracer-web
Finally, navigate to http://localhost/ in your web browser et voilà!
You shouldn’t need to configure this ridiculous piece of software, but if you want to it’s as easy as setting one of the following environment variables,
RESOLUTION
- Resolution in <WIDTH>x<HEIGHT>
format, by default 800x600
.
PASSWORD
- VNC password, by default there is none.VERBOSE
- If set to 1
, spew out log information at the terminal.ICECAST
- If set to 1
, use experimental Icecast
sound server. More details below.
For example, the following runs at 1024x768
resolution, sets the VNC password
to shrimp
, and prints verbose log information,
docker run -p 80:80 -e RESOLUTION=1024x768 -e PASSWORD=shrimp -e VERBOSE=1 dtcooper/tuxracer-web
If you want to give the experimental Icecast sound
backend a try, just set the environment variable ICECAST=1
. It should start
playing in your browser. Note that this will be massively delayed due to
encoding and buffering by the server, as well as buffering by your browser.
docker run -p 80:80 -e ICECAST=1 dtcooper/tuxracer-web
To make sound work on Linux, just expose your /dev/snd
device while starting
up the container.
docker run -p 80:80 --device /dev/snd dtcooper/tuxracer-web
On macOS, first install PulseAudio, for example here using Homebrew,
brew install pulseaudio
Next, start PulseAudio loading the native-protocol-tcp
module and share its
configuration directory. This way the Pulse daemon’s auth cookie can be shared
with the container and it can forward sound.
pulseaudio --load=module-native-protocol-tcp --exit-idle-time=-1 --daemon
docker run -p 80:80 -v ~/.config/pulse:/root/.config/pulse dtcooper/tuxracer-web
If you for some odd reason want a shell or to run a program inside of the
container, provide it as an argument. For example to shell into bash
,
docker run -it -p 80:80 dtcooper/tuxracer-web bash
Clone this repo and build the container,
git clone https://github.com/dtcooper/tuxracer-web
docker build -t tuxracer-web tuxracer-web
Finally run it locally,
docker run -p 80:80 tuxracer-web
That’s all folks!
This project was created by David Cooper and is licensed
under the MIT License. See the
LICENSE
file
for details.