Browse Source

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

Docker support
Konrad Kuśnierz 1 year ago
parent
commit
c58bf46f5e
No account linked to committer's email address
4 changed files with 62 additions and 0 deletions
  1. 31
    0
      Dockerfile
  2. 9
    0
      README.md
  3. 3
    0
      build.sh
  4. 19
    0
      run.sh

+ 31
- 0
Dockerfile View File

@@ -0,0 +1,31 @@
1
+from ubuntu:latest
2
+
3
+WORKDIR /app
4
+
5
+RUN apt-get update; apt-get install -y \
6
+  build-essential \
7
+  cmake \
8
+  git-core \
9
+  libboost-all-dev \
10
+  libglew-dev \
11
+  liblua5.1-0-dev \
12
+  libopenal-dev \
13
+  libphysfs-dev \
14
+  libssl-dev \
15
+  libvorbis-dev \
16
+  zlib1g-dev
17
+
18
+RUN apt-get install -y \
19
+  libncurses5-dev \
20
+  mercurial; \
21
+  hg clone -r stable-2.0 http://hg.icculus.org/icculus/physfs/; \
22
+    cd physfs; \
23
+    mkdir build && cd build && cmake .. && make && make install; \
24
+    mv /usr/local/lib/libphysfs.a /usr/lib/x86_64-linux-gnu/.
25
+
26
+ADD . /app
27
+
28
+# Build application
29
+RUN mkdir -p build && cd build && cmake .. && make -j$(grep -c ^process /proc/cpuinfo); 
30
+
31
+CMD cd build; ./otclient 

+ 9
- 0
README.md View File

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

+ 3
- 0
build.sh View File

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

+ 19
- 0
run.sh View File

@@ -0,0 +1,19 @@
1
+#!/usr/bin/env bash
2
+
3
+SE_enforcing=`getenforce` || true
4
+
5
+sudo setenforce Permissive || true
6
+
7
+# Enable any host to connect on X Org
8
+xhost +
9
+
10
+docker run -ti --rm \
11
+       -e DISPLAY \
12
+       -v /tmp/.X11-unix:/tmp/.X11-unix \
13
+       --device /dev/dri \
14
+       edubart/otclient 
15
+
16
+# Enable any host to connect on X Org
17
+xhost -
18
+
19
+sudo setenforce $SE_enforcing || true

Loading…
Cancel
Save