Improve Dockerfile

This commit is contained in:
Dan Balasescu 2024-10-28 20:23:25 +09:00
parent a7f3fe450d
commit f46a595008
No known key found for this signature in database
3 changed files with 21 additions and 12 deletions

View File

@ -1,11 +1,20 @@
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y \
dotnet-sdk-8.0 \
python3 \
git \
build-essential
RUN apt-get update && \
apt-get install -y dotnet-sdk-8.0 python3 git build-essential && \
ln -s /usr/bin/python3 /usr/bin/python
RUN ln -s /usr/bin/python3 /usr/bin/python
WORKDIR /app
COPY . .
RUN dotnet tool restore && \
dotnet restore --ucr SDL3-CS/SDL3-CS.csproj && \
rm -r /app
SHELL ["/bin/bash", "-c"]
WORKDIR /
RUN echo '#!/bin/bash' >> entrypoint.sh && \
echo 'export LD_LIBRARY_PATH="$(echo ~/.nuget/packages/libclang.runtime.*/*/runtimes/*/native):$(echo ~/.nuget/packages/libclangsharp.runtime.*/*/runtimes/*/native):${LD_LIBRARY_PATH:-}"' >> entrypoint.sh && \
echo 'export CPLUS_INCLUDE_PATH="$(echo /usr/lib/gcc/*/*/include):/usr/include:${CPLUS_INCLUDE_PATH:-}"' >> entrypoint.sh && \
echo 'python3 SDL3-CS/generate_bindings.py "$@"' >> entrypoint.sh && \
chmod +x entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

0
External/.dockerignore vendored Normal file
View File

View File

@ -3,11 +3,11 @@
set -eu
pushd "$(dirname "$0")/../" >/dev/null
dotnet tool restore
dotnet restore --ucr SDL3-CS/SDL3-CS.csproj
export LD_LIBRARY_PATH="$(echo ~/.nuget/packages/libclang.runtime.*/*/runtimes/*/native):$(echo ~/.nuget/packages/libclangsharp.runtime.*/*/runtimes/*/native):${LD_LIBRARY_PATH:-}"
export CPLUS_INCLUDE_PATH="$(echo /usr/lib/gcc/*/*/include):/usr/include:${CPLUS_INCLUDE_PATH:-}"
#dotnet tool restore
#dotnet restore --ucr SDL3-CS/SDL3-CS.csproj
#
#export LD_LIBRARY_PATH="$(echo ~/.nuget/packages/libclang.runtime.*/*/runtimes/*/native):$(echo ~/.nuget/packages/libclangsharp.runtime.*/*/runtimes/*/native):${LD_LIBRARY_PATH:-}"
#export CPLUS_INCLUDE_PATH="$(echo /usr/lib/gcc/*/*/include):/usr/include:${CPLUS_INCLUDE_PATH:-}"
python3 SDL3-CS/generate_bindings.py "$@"