Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ RUN find /app -name '*.xml' -delete
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime

RUN apt-get update \
&& apt-get install -y \
libaio1 \
&& apt-get install -y --no-install-recommends \
libaio1 \
liblua5.4-0 \
dpkg-dev \
&& ARCH="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" \
&& DN_DIR=$(ls -d /usr/share/dotnet/shared/Microsoft.NETCore.App/* 2>/dev/null | head -n1 || true) \
&& if [ -n "$DN_DIR" ]; then ln -sf "/usr/lib/${ARCH}/liblua5.4.so.0" "$DN_DIR/liblua54.so"; fi \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir /data /app \
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ RUN find /app -name '*.xml' -delete
FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine AS runtime

# Install dependencies
RUN apk update && apk add --upgrade libaio gcompat
RUN apk update && apk add --no-cache \
libaio \
gcompat \
lua5.4-libs \
&& ARCH="$(apk --print-arch)" \
&& DN_DIR=$(ls -d /usr/share/dotnet/shared/Microsoft.NETCore.App/* 2>/dev/null | head -n1 || true) \
&& if [ -n "$DN_DIR" ]; then ln -sf "/usr/lib/liblua-5.4.so.0" "$DN_DIR/liblua54.so"; fi

RUN mkdir /data /app \
&& chown -R $APP_UID:$APP_UID /data /app
Expand Down
14 changes: 14 additions & 0 deletions Dockerfile.cbl-mariner
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,23 @@ RUN dotnet publish -a $TARGETARCH -c Release -o /app --no-restore --self-contain
# Delete xmldoc files
RUN find /app -name '*.xml' -delete

# --- Lua builder stage ---
FROM ubuntu:22.04 AS lua-builder
RUN apt-get update \
&& apt-get install -y --no-install-recommends liblua5.4-0 dpkg-dev \
&& ARCH="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" \
&& mkdir -p /lua \
&& cp "/usr/lib/${ARCH}/liblua5.4.so.0" /lua/ \
&& ln -sf "liblua5.4.so.0" /lua/liblua54.so \
&& rm -rf /var/lib/apt/lists/*

# Final stage/image
FROM mcr.microsoft.com/dotnet/runtime:8.0-cbl-mariner2.0 AS runtime

COPY --from=lua-builder /lua /lua
RUN DN_DIR=$(ls -d /usr/share/dotnet/shared/Microsoft.NETCore.App/* | head -n1) \
&& cp /lua/liblua54.so "$DN_DIR/liblua54.so"

# Install libaio
RUN tdnf install -y libaio && tdnf clean all

Expand Down
20 changes: 20 additions & 0 deletions Dockerfile.chiseled
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,31 @@ RUN dotnet publish -a $TARGETARCH -c Release -o /app --no-restore --self-contain
# Delete xmldoc files
RUN find /app -name '*.xml' -delete

# --- Lua builder stage ---
FROM ubuntu:22.04 AS lua-builder
RUN apt-get update \
&& apt-get install -y --no-install-recommends liblua5.4-0 dpkg-dev \
&& ARCH="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" \
&& mkdir -p /lua \
&& cp "/usr/lib/${ARCH}/liblua5.4.so.0" /lua/ \
&& ln -sf "liblua5.4.so.0" /lua/liblua54.so \
&& rm -rf /var/lib/apt/lists/*

# --- .NET build and layout prep ---
FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy AS prep-runtime

# prep-runtime image HAS /bin/sh, so we can script here
COPY --from=lua-builder /lua /lua
RUN DN_DIR=$(ls -d /usr/share/dotnet/shared/Microsoft.NETCore.App/* | head -n1) \
&& cp /lua/liblua54.so "$DN_DIR/liblua54.so"

# Final stage/image
FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy-chiseled AS runtime
WORKDIR /app

COPY --from=build --chown=$APP_UID:$APP_UID /data /data
# Copy the pre-symlinked .NET shared directory from prep-runtime
COPY --from=prep-runtime /usr/share/dotnet/shared /usr/share/dotnet/shared
COPY --from=build /app .

VOLUME /data
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy AS runtime
# Copy libaio1 from amd64 builder stage (avoiding installation under QEMU)
COPY --from=builder /usr/lib/x86_64-linux-gnu/libaio.so.1 /usr/lib/x86_64-linux-gnu/

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
liblua5.4-0 \
dpkg-dev \
&& ARCH="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" \
&& DN_DIR=$(ls -d /usr/share/dotnet/shared/Microsoft.NETCore.App/* 2>/dev/null | head -n1 || true) \
&& if [ -n "$DN_DIR" ]; then ln -sf "/usr/lib/${ARCH}/liblua5.4.so.0" "$DN_DIR/liblua54.so"; fi \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir /data /app \
&& chown -R $APP_UID:$APP_UID /data /app

Expand Down