Giter Club home page Giter Club logo

zwift's Introduction

Zwift

Zwift updater image-href image-href image-href

Hello fellow zwifters, here is a docker image for running zwift on linux. It uses the companion app by zwift for linking up smart trainers and other bluetooth/ant devices. The reason why I made this solution was so i could run multiple zwift instances on one machine at the same time.

The container comes pre-installed with zwift, so no setup is required, simply pull and run. It should also now support all manner of graphics cards that has gl rendering.

If you find this image useful, then feel free add me on zwift and give me a ride on from time to time.

example.gif

Prerequisites

  • Docker or Podman
  • nvidia-container-toolkit if you have nvidia proprietary driver
  • ATI, Intel and Nouveau drivers should work out of the box (not tested)
  • Allow container to access the x-host by issuing the command xhost + (this will however allow everyone to your X server which is considere unsafe, if this is a concern of yours, then man xhost)

Quickstart guide

wget https://raw.githubusercontent.com/netbrain/zwift/master/zwift.sh -P ~/bin
chmod +x ~/bin/zwift.sh
~/bin/zwift.sh

Or you can run the following instead:

xhost +
docker pull netbrain/zwift:latest
docker run --gpus all \ 
 --privileged \
 --rm \
 -e DISPLAY=$DISPLAY \
 -v /tmp/.X11-unix:/tmp/.X11-unix \
 -v /run/user/$UID/pulse:/run/user/1000/pulse \
netbrain/zwift:latest

Instead of --gpus all, it might suffice to do a -v /dev/dri:/dev/dri instead depending on your graphics card and drivers.

Please note that the above command does not mount a volume to persist configuration files. If you want a proper setup then please use zwift.sh.

How do I connect my trainer, heart rate monitor, etc?

You can use your phone as a bridge.

For example, your Wahoo Kickr and Apple Watch conect to the Zwift Companion app on your iPhone; then the Companion app connects over wifi to your PC running Zwift.

How can I build the image myself?

docker build -t netbrain/zwift .
docker run --gpus all \
 --privileged \
 --name zwift \
 -e DISPLAY=$DISPLAY \
 -v /tmp/.X11-unix:/tmp/.X11-unix \
netbrain/zwift

After install and update is complete stop the container docker stop zwift and proceed with comitting a new version.

export VERSION=1.20.0			  		# Or whatever the latest version is
docker commit zwift netbrain/zwift:$VERSION 		# Create a new image with the latest update
docker rm zwift 					# Remove the no longer needed container

How can I fetch the image from docker hub?

https://hub.docker.com/r/netbrain/zwift

docker pull netbrain/zwift:$VERSION # or simply latest

How can I update Zwift?

Zwift does not update on it's own. So in order to keep zwift up to date you can simply pull netbrain/zwift:latest from time to time. There is a github action in place that will update zwift on a scheduled basis and publish new versions to docker hub.

Contibute

If you would like to contribute, then please by all means I'll accept PR's. A good starting point would be to see if there's any open issues that you feel capable of doing. Let me know if I can help with anything.

Alternative's to this repository

  • Install zwift using wine directly or a framework like lutris. You will however have to manage installation and updates yourself
  • Use scrcpy to mirror android device to your linux screen
  • Using redroid to install zwift apk onto a android emulator (not tested)

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.