From 747000647fef7940ca57a001abd12d4b92990295 Mon Sep 17 00:00:00 2001 From: Zach Dwiel Date: Wed, 12 Sep 2018 19:58:26 +0000 Subject: [PATCH] add dockerfile --- docker/Dockerfile | 32 ++++++++++++++++++++++++++++++++ docker/Makefile | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 docker/Dockerfile create mode 100644 docker/Makefile diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..a19f759 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,32 @@ +FROM ubuntu:16.04 + +RUN apt-get update \ + && apt-get install -y \ + python3-pip cmake zlib1g-dev python3-tk python-opencv \ + libboost-all-dev \ + libblas-dev liblapack-dev libatlas-base-dev gfortran \ + libsdl-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev \ + libsmpeg-dev libportmidi-dev libavformat-dev libswscale-dev \ + dpkg-dev build-essential python3.5-dev libjpeg-dev libtiff-dev \ + libsdl1.2-dev libnotify-dev freeglut3 freeglut3-dev libsm-dev \ + libgtk2.0-dev libgtk-3-dev libwebkitgtk-dev libgtk-3-dev \ + libwebkitgtk-3.0-dev libgstreamer-plugins-base1.0-dev \ + libav-tools libsdl2-dev swig + +# installing python dependencies +RUN pip3 install --upgrade pip + +RUN mkdir /root/src +COPY setup.py /root/src/. +COPY README.md /root/src/. +WORKDIR /root/src +RUN pip3 install -e . +# +COPY . /root/src +WORKDIR /root/src +RUN pip3 install -e . + +# RUN pip3 install rl_coach + +# CMD ["coach", "-p", "CartPole_PG", "-e", "cartpole"] +CMD python3 rl_coach/rollout_worker.py diff --git a/docker/Makefile b/docker/Makefile new file mode 100644 index 0000000..5b812ab --- /dev/null +++ b/docker/Makefile @@ -0,0 +1,38 @@ +IMAGE=zdwiel/coach +# IMAGE=gcr.io/deep-greens/inference:v5 + +BUILD_ARGUMENTS= +RUN_ARGUMENTS= +ifdef http_proxy + BUILD_ARGUMENTS+=--build-arg http_proxy=$(http_proxy) + RUN_ARGUMENTS+=--env http_proxy=$(http_proxy) +endif + +ifdef https_proxy + BUILD_ARGUMENTS+=--build-arg https_proxy=$(https_proxy) + RUN_ARGUMENTS+=--env https_proxy=$(https_proxy) +endif + +RUN_ARGUMENTS+=--rm +RUN_ARGUMENTS+=--net host + +CONTEXT = $(realpath ..) + +ifndef DOCKER + DOCKER = docker +endif + +build: + ${DOCKER} build -f=Dockerfile -t=${IMAGE} ${BUILD_ARGUMENTS} ${CONTEXT} + +shell: build + ${DOCKER} run ${RUN_ARGUMENTS} -it ${IMAGE} /bin/bash + +test: build + ${DOCKER} run ${RUN_ARGUMENTS} -it ${IMAGE} py.test tests + +run: build + ${DOCKER} run ${RUN_ARGUMENTS} -it ${IMAGE} + +push: + docker push ${IMAGE}