Ver Fonte

Modified to allow username, team, and power level to be set via docker environment variables

Jordan Day há 10 anos atrás
pai
commit
c07912e4f4
2 ficheiros alterados com 12 adições e 4 exclusões
  1. 9 1
      Dockerfile
  2. 3 3
      config.xml

+ 9 - 1
Dockerfile

@@ -1,16 +1,24 @@
 # Folding@home
 #
 # VERSION               0.1
-# Run with: docker run -d -t -i magglass1/docker-folding-at-home
+# Run with: docker run -d -t -i jordan0day/folding-at-home
+# Inspired by magglass1/docker-folding-at-home
+
+# Set environment variables USERNAME, TEAM, and POWER to customize your Folding client.
 
 FROM fedora
 
+ENV USERNAME Anonymous
+ENV TEAM 0
+ENV POWER medium
+
 # Install updates
 RUN yum update -y
 
 # Install Folding@home
 RUN rpm -i https://fah.stanford.edu/file-releases/public/release/fahclient/centos-5.3-64bit/v7.3/fahclient-7.3.6-1.x86_64.rpm
 ADD config.xml /etc/fahclient/
+RUN sed -i -e "s/{{USERNAME}}/$USERNAME/;s/{{TEAM}}/$TEAM/;s/{{POWER}}/$POWER/" config.xml
 RUN chown fahclient:root /etc/fahclient/config.xml
 
 CMD /etc/init.d/FAHClient start && tail -F /var/lib/fahclient/log.txt

+ 3 - 3
config.xml

@@ -1,9 +1,9 @@
 <config>
-  <user value="magglass1"/>
-  <team value="2740"/>
+  <user value="{{USERNAME}}"/>
+  <team value="{{TEAM}}"/>
   <passkey value=""/>
 
-  <power value="light"/>
+  <power value="{{POWER}}"/>
   <gpu value="false"/>
   <fold-anon value="false"/>
 </config>