Skip to content

Commit

Permalink
Merge pull request JoeyDeVries#107 from arteniioleg/master
Browse files Browse the repository at this point in the history
Build and run in docker
  • Loading branch information
JoeyDeVries authored Apr 24, 2018
2 parents 2ae5ac0 + 609cecc commit 6323e74
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**
!Dockerfile
17 changes: 17 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:18.04

ARG TINI_VERSION='0.18.0'

RUN apt-get update \
&& apt-get install -y \
libgtk2.0-0 libcanberra-gtk-module libxext-dev libxrender-dev libxtst-dev libxslt-dev dmz-cursor-theme \
build-essential cmake git \
libglfw3-dev libassimp-dev libxinerama-dev libxcursor-dev mesa-utils mesa-utils-extra \
wget htop zip unzip nano

ADD https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini /tini
RUN chmod +x /tini

ENTRYPOINT ["/tini", "--"]

CMD ["sleep", "infinity"]
31 changes: 31 additions & 0 deletions docker/ide.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

[ -n "$(which x11docker)" ] \
|| { echo "x11docker is required https://github.com/mviereck/x11docker"; exit 1; }

SCRIPT_DIR=$(dirname $(readlink -f "$0"))
PROJECT_DIR=$(dirname ${SCRIPT_DIR})

CMD=${@}
[ -n "${CMD}" ] \
|| { echo "Command is required"; exit 1; }

IMAGE=learnopengl

[ -n "$(docker images -q --filter=reference="${IMAGE}")" ] \
|| docker build -t ${IMAGE} ${SCRIPT_DIR}

echo "Info about --gpu https://github.com/mviereck/x11docker#dependencies"

x11docker \
--gpu \
--hostdisplay \
--homedir ${HOME} \
--clipboard \
--stdout --stderr \
--cap-default \
--no-init \
--workdir ${PROJECT_DIR} \
-- "--cap-add=SYS_PTRACE" \
${IMAGE} \
${CMD}

0 comments on commit 6323e74

Please sign in to comment.