docker in ballistica :o

This commit is contained in:
Loup-Garou911XD 2024-05-17 03:08:06 +05:30
parent 591b90a5fe
commit acb42d1ff4
5 changed files with 60 additions and 0 deletions

View File

@ -222,6 +222,10 @@ pcommandbatch_speed_test: env
# Prebuilt binaries for various platforms.
docker-linux-x86-64-server-release-build:
$(PCOMMAND) build_docker
# WSL is Linux but running under Windows, so it can target either. By default
# we want these top level targets (prefab-gui-debug, etc.) to yield native
# Windows builds from WSL, but this env var can be set to override that.

View File

@ -0,0 +1,32 @@
FROM ubuntu:24.04
ENV LANG en_US.utf8
ENV LANGUAGE=en_US
ARG BOMBSQUAD_VERSION=N/A
ARG SOURCE_DIR=.
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update -y && \
apt-get install -y \
python3.12-dev \
libsdl2-dev \
libvorbisfile3 \
freeglut3-dev \
libopenal-dev
# Clean up
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/*
WORKDIR ${SOURCE_DIR}
COPY ${SOURCE_DIR} ./
LABEL bombsquad_version=$BOMBSQUAD_VERSION
CMD [ "./ballisticakit_server" ]
# this does not port forward locally
# its just a hint for user which port to forward
EXPOSE 43210/udp

View File

@ -644,3 +644,20 @@ def cmake_prep_dir(dirname: str, verbose: bool = False) -> None:
else:
if verbose:
print(f'{Clr.BLD}{title}:{Clr.RST} Keeping existing build dir.')
def _docker_build(image_name,
dockerfile_dir,
bombsquad_version,
source_dir) -> None:
build_cmd = ['docker','image','build',
'-t',image_name,
dockerfile_dir,
'--build-arg', f'BOMBSQUAD_VERSION={bombsquad_version}',
'--build-arg', f'SOURCE_DIR={source_dir}']
subprocess.run(build_cmd,check=True)
# add option to toggle between prefab and cmake
def docker_build() -> None:
_docker_build('bsquad','src/assets/docker/','1.7.69','build/prefab/full/linux_x86_64_server/release')

View File

@ -104,6 +104,7 @@ from batools.pcommands import (
ensure_prefab_platform,
prefab_run_var,
prefab_binary_path,
build_docker,
make_prefab,
lazybuild,
efro_gradle,

View File

@ -666,6 +666,12 @@ def prefab_binary_path() -> None:
end='',
)
def build_docker() -> None:
pass
import subprocess
import batools.build
batools.build.docker_build()
def make_prefab() -> None:
"""Run prefab builds for the current platform."""