-
Notifications
You must be signed in to change notification settings - Fork 12
Create Docker container setup for the project #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM ubuntu:focal | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN <<EOF | ||
# build SDL2 | ||
# define installation directory | ||
mkdir SDL2 | ||
export SDL2_INSTALLATION=/SDL2 | ||
# clone SDL | ||
apt-get update -y | ||
apt install -y git build-essential | ||
git clone https://github.com/libsdl-org/SDL.git -b SDL2 && cd SDL && git checkout tags/release-2.26.2 | ||
# build | ||
mkdir build && cd build && ../configure --prefix=$SDL2_INSTALLATION --enable-video-offscreen && make && make install | ||
EOF | ||
|
||
RUN <<EOF | ||
# build Irrlicht | ||
# install missing dependency | ||
apt-get update -y | ||
apt install -y zlib1g-dev libjpeg-dev libpng-dev libxi-dev cmake | ||
# clone irrlicht | ||
git clone https://github.com/EleutherAI/irrlicht && cd irrlicht && git checkout disable-x11 | ||
Ryu1845 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# define lib paths | ||
export SDL2_INSTALLATION=/SDL2 | ||
# build | ||
cmake . -DBUILD_SHARED_LIBS=OFF -DBUILD_HEADLESS=1 -DSDL2_DIR=$SDL2_INSTALLATION/lib/cmake/SDL2 | ||
make -j8 | ||
EOF | ||
|
||
RUN <<EOF | ||
# build minetest | ||
# install dependencies | ||
apt-get update -y | ||
apt install -y libzmqpp-dev libgmp3-dev protobuf-compiler libprotobuf-dev libzstd-dev libfreetype-dev libsqlite3-dev | ||
# clone minetest fork | ||
git clone https://github.com/EleutherAI/minetest | ||
git clone --depth 1 https://github.com/minetest/minetest_game.git minetest/games/minetest_game | ||
cd minetest | ||
git checkout cmake-SDL2-target-fix | ||
Ryu1845 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# compile protobuf | ||
cd hacking_testing | ||
./compile_proto.sh | ||
cd .. | ||
# define lib paths | ||
export SDL2_INSTALLATION=/SDL2 | ||
export IRRLICHT_REPO=/irrlicht | ||
# build | ||
cd minetest | ||
cmake . -B build_headless_render -DCMAKE_BUILD_TYPE=Debug -DSDL2_DIR=$SDL2_INSTALLATION/lib/cmake/SDL2 -DIRRLICHTMT_BUILD_DIR=$IRRLICHT_REPO -DBUILD_HEADLESS=1 -DENABLE_SOUND=OFF -DRUN_IN_PLACE=1 | ||
cmake --build build_headless_render | ||
EOF | ||
|
||
RUN <<EOF | ||
# Install Python packages and Xvfb | ||
apt-get install -y python3 python3-pip xvfb | ||
pip install numpy matplotlib gym zmq protobuf | ||
EOF | ||
|
||
WORKDIR minetest | ||
EXPOSE 30000 | ||
CMD ["hacking_testing/server.sh"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this got me wondering, will we need a separate Dockerfile for clients? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CMD is just a default, we could make a cli with support for the different options as an entry point maybe? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, that sounds good. even simpler: optionally pass a any script that is being used as entrypoint |
Uh oh!
There was an error while loading. Please reload this page.