Docker images are, by default, a Debian (Linux) file system.
Start from a Docker image of Python 2.7
FROM python 2.7.13
Get the Psychopy files from neuro-debian using apt-get.
RUN apt-get update
RUN wget -O- http://neuro.debian.net/lists/jessie.de-m.libre | tee /etc/apt/sources.list.d/neurodebian.sources.list
I had problems getting the key to work - apt-key failed - so I manually copied the text of the page from the keyserver (the whole thing, including the titles formatted in bold etc), saved it to a text file on my own machine, copied that text file into a "keys" directory on the Debian system:
WORKDIR /keys
COPY ./[filename.txt] .
then added that to the key list:
RUN apt-key add ./[filename.txt]
Psychopy package on neurodebian requires neurodebian-popularity-contest, a usage monitoring package that asks for permission to feedback which packages are in use. Docker scripts are noninteractive, so this breaks things unless you prepend DEBIAN_FRONTEND=noninteractive:
RUN DEBIAN_FRONTEND=noninteractive apt-get install neurodebian-popularity-contest -y -q
RUN apt-get install psychopy -y
The python module pyglet isn't packaged for some reason, so install that separately:
RUN apt-get install python-pyglet
Full build script so far:
FROM python:2.7.13
RUN apt-get update
RUN wget -O- http://neuro.debian.net/lists/jessie.de-m.libre | tee /etc/apt/sources.list.d/neurodebian.sources.list
WORKDIR /keys
COPY ./neuro-debian_key.txt .
RUN apt-key add ./neuro-debian_key.txt
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install neurodebian-popularity-contest -y -q
RUN apt-get install psychopy -y
RUN apt-get install python-pyglet
Build this using:
docker build . -f [filename] -t psychopy
Run it using:
docker run psychopy
Install Cygwin, as in "Running C code on Windows". Open it and run:
cd C:\cygdrive
wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
install apt-cyg /bin
apt-cyg install xinit wget screen
startxwin -- -nolock # FAT32 workaround
This installs an "X server", which lets you see graphics from your Linux Docker container on your Windows machine's screen.
Then install xhost:
apt-cyg install xhost
Then start the X server:
export DISPLAY=:0.0 ###This step I'm not sure about: should it have the IP or not?
startxwin -- -listen tcp & $ xhost + localhost
docker run -ti --rm -e DISPLAY=$DISPLAY [docker-image-name]