work in progress on docker build

This commit is contained in:
Loup-Garou911XD 2024-05-17 05:53:50 +05:30
parent acb42d1ff4
commit 4382c396e5
4 changed files with 42 additions and 17 deletions

View File

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

View File

@ -222,9 +222,11 @@ pcommandbatch_speed_test: env
# Prebuilt binaries for various platforms.
docker-linux-x86-64-server-release-build:
docker-build:
$(PCOMMAND) build_docker
docker-run:
docker run -i bsquad
# 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

7
do_stuff Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
pwd
echo
ls
echo
rm tools/pcommand
make env

View File

@ -647,17 +647,25 @@ def cmake_prep_dir(dirname: str, verbose: bool = False) -> None:
def _docker_build(image_name,
dockerfile_dir,
bombsquad_version,
source_dir) -> None:
bombsquad_version = None,
project_root = None) -> 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}']
]
if bombsquad_version is not None:
build_cmd = build_cmd+['--build-arg', f'BOMBSQUAD_VERSION={bombsquad_version}']
# if project_root is not None:
# print(project_root)
# build_cmd = build_cmd+['--build-arg', f'PROJ_ROOT={project_root}']
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')
_docker_build('bsquad',
'.',
'1.7.69',
os.getcwd(),
)