BootStrap: docker
From: ubuntu:16.04

%environment
export LC_ALL=C
export LD_LIBRARY_PATH=/.mujoco/mujoco200/bin:${LD_LIBRARY_PATH}
export MUJOCO_PATH=/.mujoco
export MUJOCO_PY_MUJOCO_PATH=/.mujoco/mujoco200
export MUJOCO_PY_MJKEY_PATH=/.mujoco/mjkey.txt
export SETUPTOOLS_USE_DISTUTILS=stdlib

%post
	apt-get update
	apt-get -y install software-properties-common
	add-apt-repository ppa:deadsnakes/ppa
	apt-get update 
	apt-get -y install git python3.6 python3.6-dev python3.6-tk python3-pip curl wget unzip libgl1-mesa-glx ffmpeg
	apt-get -y install libgl1-mesa-dev  libosmesa6-dev libglfw3 libglew-dev
	curl -o /usr/local/bin/patchelf https://s3-us-west-2.amazonaws.com/openai-sci-artifacts/manual-builds/patchelf_0.9_amd64.elf
	chmod +x /usr/local/bin/patchelf
	export LD_LIBRARY_PATH=/.mujoco/mujoco200/bin:${LD_LIBRARY_PATH}
	export MUJOCO_PATH=/.mujoco
	export MUJOCO_PY_MJKEY_PATH=/.mujoco/mjkey.txt
	export MUJOCO_PY_MUJOCO_PATH=/.mujoco/mujoco200
	export MUJOCO_ZIP="https://www.roboti.us/download/mujoco200_linux.zip"	
	mkdir -p $MUJOCO_PATH
	wget -P $MUJOCO_PATH/ $MUJOCO_ZIP
	unzip ${MUJOCO_PATH}/mujoco200_linux.zip -d ${MUJOCO_PATH}
	mv ${MUJOCO_PATH}/mujoco200_linux ${MUJOCO_PATH}/mujoco200
	rm ${MUJOCO_PATH}/mujoco200_linux.zip
	python3.6 -m pip install --upgrade pip
	python3.6 -m pip install --upgrade setuptools
	python3.6 -m pip install --default-timeout=200 numpy tensorflow==1.14.0 matplotlib==3.0.2 PyQt5==5.11.3 QtPy==1.5.2 geoopt==0.2.0 seaborn==0.9.0 networkx==2.5 randomdict==0.2.0
	python3.6 -m pip install --default-timeout=200 pygame lockfile gym[all]==0.15.3 gensim plotly psutil
	python3.6 -m pip install git+https://github.com/vitchyr/multiworld.git git+https://github.com/openai/baselines.git
	git clone https://github.com/piojanu/mujoco-py.git
	cd gym-minigrid
	python3.6 -m pip install .
	cd ../mujoco-py
	export SETUPTOOLS_USE_DISTUTILS=stdlib
	python3.6 -m pip install --no-cache-dir -r requirements.txt
	python3.6 -m pip install --no-cache-dir -r requirements.dev.txt
	python3.6 -m pip install .
	python3.6 -m pip install torch==1.6.0

%files
    mjkey/mjkey.txt /.mujoco/
    gym-minigrid /gym-minigrid
    

	


