Merge pull request #954 from DavidUser/feature/docker-support

Docker support
This commit is contained in:
Konrad Kuśnierz 2019-01-16 14:08:09 +01:00 committed by GitHub
commit c58bf46f5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 0 deletions

31
Dockerfile Normal file
View File

@ -0,0 +1,31 @@
from ubuntu:latest
WORKDIR /app
RUN apt-get update; apt-get install -y \
build-essential \
cmake \
git-core \
libboost-all-dev \
libglew-dev \
liblua5.1-0-dev \
libopenal-dev \
libphysfs-dev \
libssl-dev \
libvorbis-dev \
zlib1g-dev
RUN apt-get install -y \
libncurses5-dev \
mercurial; \
hg clone -r stable-2.0 http://hg.icculus.org/icculus/physfs/; \
cd physfs; \
mkdir build && cd build && cmake .. && make && make install; \
mv /usr/local/lib/libphysfs.a /usr/lib/x86_64-linux-gnu/.
ADD . /app
# Build application
RUN mkdir -p build && cd build && cmake .. && make -j$(grep -c ^process /proc/cpuinfo);
CMD cd build; ./otclient

View File

@ -36,6 +36,15 @@ In short, if you need to compile OTClient, follow these tutorials:
* [Compiling on Linux](https://github.com/edubart/otclient/wiki/Compiling-on-Linux) * [Compiling on Linux](https://github.com/edubart/otclient/wiki/Compiling-on-Linux)
* [Compiling on OS X](https://github.com/edubart/otclient/wiki/Compiling-on-Mac-OS-X) * [Compiling on OS X](https://github.com/edubart/otclient/wiki/Compiling-on-Mac-OS-X)
### Build and run with Docker
To build and run the client without copile by hand:
```
./build.sh
./run.sh
```
The build step should be run just when something on implementation changes.
### Need help? ### Need help?

3
build.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
docker build -t edubart/otclient .

19
run.sh Executable file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
SE_enforcing=`getenforce` || true
sudo setenforce Permissive || true
# Enable any host to connect on X Org
xhost +
docker run -ti --rm \
-e DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--device /dev/dri \
edubart/otclient
# Enable any host to connect on X Org
xhost -
sudo setenforce $SE_enforcing || true