From 4379db65d51b994c10d207851970f7d8a0fbe4d0 Mon Sep 17 00:00:00 2001 From: Casey LP <11209477+soup-bowl@users.noreply.github.com> Date: Thu, 2 Apr 2026 23:45:00 +0100 Subject: [PATCH] Switch to source builds for tagged releases (#15) * Switched all builds to source builds. * Copilot PR review fixes. --- .github/workflows/build-beta.yml | 2 +- .github/workflows/build-main.yml | 7 ----- build/latest/Dockerfile | 46 ++++++++++++++++++-------------- build/latest/Dockerfile.alpine | 28 ++++++++++++------- build/latest/Dockerfile.mono | 38 ++++++++++++++++---------- build/latest/Dockerfile.screen | 39 +++++++++++++++------------ build/latest/Dockerfile.source | 45 ------------------------------- docker-compose.yml | 2 +- 8 files changed, 93 insertions(+), 114 deletions(-) delete mode 100644 build/latest/Dockerfile.source diff --git a/.github/workflows/build-beta.yml b/.github/workflows/build-beta.yml index 9b82680..51203ab 100644 --- a/.github/workflows/build-beta.yml +++ b/.github/workflows/build-beta.yml @@ -25,7 +25,7 @@ jobs: - version: master tag: source folder: build/latest - file: Dockerfile.source + file: Dockerfile platforms: linux/amd64 steps: diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index 46afbb5..7d90969 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -26,7 +26,6 @@ jobs: folder: build/latest file: Dockerfile.mono platforms: linux/amd64,linux/arm64 - sha1: 584966ef6029f21dc842a7f55f6f117b3a0b0321 - version: "0.9.2.1" tag: > soupbowl/opensimulator:0.9.2.1, @@ -34,7 +33,6 @@ jobs: folder: build/latest file: Dockerfile.mono platforms: linux/amd64,linux/arm64 - sha1: c5d2e690a7739fa9c0651845b31d912f88d6fa22 - version: "0.9.2.2" tag: > soupbowl/opensimulator:0.9.2, @@ -44,7 +42,6 @@ jobs: folder: build/latest file: Dockerfile.mono platforms: linux/amd64,linux/arm64 - sha1: b280d109cf04755a02db1c729af5a5e4160d1ce6 - version: "0.9.3.0" tag: > soupbowl/opensimulator:latest, @@ -58,7 +55,6 @@ jobs: folder: build/latest file: Dockerfile platforms: linux/amd64,linux/arm64 - sha1: a4bcd861626195af80cc1f962d3a2f4528859ad2 - version: "0.9.3.0" tag: > soupbowl/opensimulator:0.9.3-screen, @@ -68,14 +64,12 @@ jobs: folder: build/latest file: Dockerfile.screen platforms: linux/amd64,linux/arm64 - sha1: a4bcd861626195af80cc1f962d3a2f4528859ad2 - version: "0.9.3.0" tag: > ghcr.io/${{ github.repository }}:alpine-beta folder: build/latest file: Dockerfile.alpine platforms: linux/amd64,linux/arm64 - sha1: a4bcd861626195af80cc1f962d3a2f4528859ad2 steps: - name: Checkout Codebase @@ -111,6 +105,5 @@ jobs: file: "${{ matrix.file }}" build-args: | OPENSIM_VERSION=${{ matrix.version }} - OPENSIM_SHA1=${{ matrix.sha1 }} cache-from: type=gha cache-to: type=gha,mode=max diff --git a/build/latest/Dockerfile b/build/latest/Dockerfile index 2650b5b..9cad9c7 100644 --- a/build/latest/Dockerfile +++ b/build/latest/Dockerfile @@ -1,32 +1,38 @@ -FROM mcr.microsoft.com/dotnet/runtime:8.0 +ARG DOTNET_VERSION=8.0 +FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS build -SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG OPENSIM_VERSION=0.9.3.0 + +# Cache Bust to avoid caching skipping the latest commit +ADD https://api.github.com/repos/opensim/opensim/git/refs/heads/${OPENSIM_VERSION} version.json +RUN git clone --depth 1 --branch "${OPENSIM_VERSION}" https://github.com/opensim/opensim.git /app +WORKDIR /app +RUN rm -rf .git && \ + ./runprebuild.sh && \ + ./compile.sh && \ + find . -name "*.pdb" -delete && \ + rm -r -- *prebuild* compile.sh ThirdParty TESTING.txt Prebuild OpenSim* Makefile BUILDING.md && \ + rm bin/config-include/storage/SQLiteStandalone.ini +COPY defaults bin/defaults + +FROM mcr.microsoft.com/dotnet/runtime:${DOTNET_VERSION} + +ARG OPENSIM_VERSION=0.9.3.0 LABEL \ org.opencontainers.image.title="OpenSimulator (unofficial)" \ org.opencontainers.image.authors="code@soupbowl.io" \ org.opencontainers.image.source="https://github.com/soup-bowl/opensimulator-docker" \ - org.opencontainers.image.licenses="MIT" - -ARG OPENSIM_VERSION=0.9.3.0 -ARG OPENSIM_SHA1="a4bcd861626195af80cc1f962d3a2f4528859ad2" + org.opencontainers.image.licenses="MIT" \ + org.opencontainers.image.version="${OPENSIM_VERSION}" # hadolint ignore=DL3008 -RUN apt-get update \ - && apt-get install --no-install-recommends -y apt-utils curl libc6-dev libgdiplus libsqlite3-dev uuid-runtime \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir /opt/opensim-tmp \ - && curl -o /opt/opensim-tmp/opensim.tar.gz "http://opensimulator.org/dist/opensim-${OPENSIM_VERSION}.tar.gz" \ - && echo "${OPENSIM_SHA1} /opt/opensim-tmp/opensim.tar.gz" | sha1sum -c - \ - && tar xzf /opt/opensim-tmp/opensim.tar.gz -C /opt/opensim-tmp \ - && rm /opt/opensim-tmp/opensim*/bin/OpenSim.ini \ - && rm /opt/opensim-tmp/opensim*/bin/config-include/StandaloneCommon.ini \ - && rm /opt/opensim-tmp/opensim*/bin/config-include/storage/SQLiteStandalone.ini \ - && mkdir /opt/opensim \ - && mv /opt/opensim-tmp/opensim*/* /opt/opensim +RUN apt-get update && \ + apt-get install --no-install-recommends -y libc6-dev libgdiplus libsqlite3-0 uuid-runtime && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* -COPY defaults /opt/opensim/bin/defaults +COPY --from=build /app /opt/opensim EXPOSE 9000 diff --git a/build/latest/Dockerfile.alpine b/build/latest/Dockerfile.alpine index db4bf88..902d29a 100644 --- a/build/latest/Dockerfile.alpine +++ b/build/latest/Dockerfile.alpine @@ -1,3 +1,20 @@ +ARG DOTNET_VERSION=8.0 +FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS build + +ARG OPENSIM_VERSION=0.9.3.0 + +# Cache Bust to avoid caching skipping the latest commit +ADD https://api.github.com/repos/opensim/opensim/git/refs/heads/${OPENSIM_VERSION} version.json +RUN git clone --depth 1 --branch "${OPENSIM_VERSION}" https://github.com/opensim/opensim.git /app +WORKDIR /app +RUN rm -rf .git && \ + ./runprebuild.sh && \ + ./compile.sh && \ + find . -name "*.pdb" -delete && \ + rm -r -- *prebuild* compile.sh ThirdParty TESTING.txt Prebuild OpenSim* Makefile BUILDING.md && \ + rm bin/config-include/storage/SQLiteStandalone.ini +COPY defaults bin/defaults + FROM alpine:3.21 SHELL ["/bin/ash", "-eo", "pipefail", "-c"] @@ -11,16 +28,9 @@ LABEL \ org.opencontainers.image.licenses="MIT" \ org.opencontainers.image.version="${OPENSIM_VERSION}" -RUN apk add --no-cache curl dotnet8-runtime libgdiplus sqlite sqlite-libs uuidgen \ - && mkdir /opt/opensim-tmp \ - && curl "http://opensimulator.org/dist/opensim-${OPENSIM_VERSION}.tar.gz" | tar xzf - -C /opt/opensim-tmp \ - && rm /opt/opensim-tmp/opensim*/bin/OpenSim.ini \ - && rm /opt/opensim-tmp/opensim*/bin/config-include/StandaloneCommon.ini \ - && rm /opt/opensim-tmp/opensim*/bin/config-include/storage/SQLiteStandalone.ini \ - && mkdir /opt/opensim \ - && mv /opt/opensim-tmp/opensim*/* /opt/opensim +RUN apk add --no-cache dotnet8-runtime libgdiplus sqlite sqlite-libs uuidgen -COPY defaults /opt/opensim/bin/defaults +COPY --from=build /app /opt/opensim EXPOSE 9000 diff --git a/build/latest/Dockerfile.mono b/build/latest/Dockerfile.mono index 33ce018..7b70a2c 100644 --- a/build/latest/Dockerfile.mono +++ b/build/latest/Dockerfile.mono @@ -1,3 +1,23 @@ +FROM soupbowl/wine-mono:6 AS build +ENV DEBIAN_FRONTEND=noninteractive + +ARG OPENSIM_VERSION=0.9.2.2 + +RUN apt-get update \ + && apt-get install --no-install-recommends -y \ + git \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN git clone --depth 1 --branch "${OPENSIM_VERSION}" git://opensimulator.org/git/opensim /app +WORKDIR /app +RUN rm -rf .git && \ + ./runprebuild.sh && \ + xbuild && \ + rm -r -- *prebuild* ThirdParty TESTING.txt Prebuild OpenSim* Makefile BUILDING.md && \ + rm bin/config-include/storage/SQLiteStandalone.ini +COPY defaults bin/defaults + FROM soupbowl/wine-mono:6 ENV DEBIAN_FRONTEND=noninteractive @@ -15,21 +35,11 @@ LABEL \ RUN apt-get update \ && apt-get install --no-install-recommends -y \ - ca-certificates curl screen uuid-runtime libglib2.0-0 libgnutls30 tzdata libgdiplus libfontconfig1 \ + ca-certificates uuid-runtime libglib2.0-0 libgnutls30 libsqlite3-0 tzdata libgdiplus libfontconfig1 \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir /opt/opensim-tmp \ - && curl -o /opt/opensim-tmp/opensim.tar.gz "http://opensimulator.org/dist/opensim-${OPENSIM_VERSION}.tar.gz" \ - && echo "${OPENSIM_SHA1} /opt/opensim-tmp/opensim.tar.gz" | sha1sum -c - \ - && tar xzf /opt/opensim-tmp/opensim.tar.gz -C /opt/opensim-tmp \ - && rm /opt/opensim-tmp/opensim*/bin/OpenSim.ini \ - && rm /opt/opensim-tmp/opensim*/bin/config-include/StandaloneCommon.ini \ - && rm /opt/opensim-tmp/opensim*/bin/config-include/storage/SQLiteStandalone.ini \ - && mkdir /opt/opensim \ - && mv /opt/opensim-tmp/opensim*/* /opt/opensim \ - && rm -rf /opt/opensim-tmp + && rm -rf /var/lib/apt/lists/* -COPY defaults /opt/opensim/bin/defaults +COPY --from=build /app /opt/opensim EXPOSE 9000 @@ -38,4 +48,4 @@ WORKDIR /opt/opensim/bin COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] -CMD [ "mono", "./OpenSim.exe" ] +CMD [ "mono", "./OpenSim.exe", "-console=basic" ] diff --git a/build/latest/Dockerfile.screen b/build/latest/Dockerfile.screen index 8c05131..61aeea1 100644 --- a/build/latest/Dockerfile.screen +++ b/build/latest/Dockerfile.screen @@ -1,9 +1,23 @@ -FROM mcr.microsoft.com/dotnet/runtime:8.0 +ARG DOTNET_VERSION=8.0 +FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS build -SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG OPENSIM_VERSION=0.9.3.0 + +# Cache Bust to avoid caching skipping the latest commit +ADD https://api.github.com/repos/opensim/opensim/git/refs/heads/${OPENSIM_VERSION} version.json +RUN git clone --depth 1 --branch "${OPENSIM_VERSION}" https://github.com/opensim/opensim.git /app +WORKDIR /app +RUN rm -rf .git && \ + ./runprebuild.sh && \ + ./compile.sh && \ + find . -name "*.pdb" -delete && \ + rm -r -- *prebuild* compile.sh ThirdParty TESTING.txt Prebuild OpenSim* Makefile BUILDING.md && \ + rm bin/config-include/storage/SQLiteStandalone.ini +COPY defaults bin/defaults + +FROM mcr.microsoft.com/dotnet/runtime:${DOTNET_VERSION} ARG OPENSIM_VERSION=0.9.3.0 -ARG OPENSIM_SHA1="a4bcd861626195af80cc1f962d3a2f4528859ad2" LABEL \ org.opencontainers.image.title="OpenSimulator (unofficial)" \ @@ -13,21 +27,12 @@ LABEL \ org.opencontainers.image.version="${OPENSIM_VERSION}" # hadolint ignore=DL3008 -RUN apt-get update \ - && apt-get install --no-install-recommends -y apt-utils curl libc6-dev libgdiplus libsqlite3-dev screen uuid-runtime \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir /opt/opensim-tmp \ - && curl -o /opt/opensim-tmp/opensim.tar.gz "http://opensimulator.org/dist/opensim-${OPENSIM_VERSION}.tar.gz" \ - && echo "${OPENSIM_SHA1} /opt/opensim-tmp/opensim.tar.gz" | sha1sum -c - \ - && tar xzf /opt/opensim-tmp/opensim.tar.gz -C /opt/opensim-tmp \ - && rm /opt/opensim-tmp/opensim*/bin/OpenSim.ini \ - && rm /opt/opensim-tmp/opensim*/bin/config-include/StandaloneCommon.ini \ - && rm /opt/opensim-tmp/opensim*/bin/config-include/storage/SQLiteStandalone.ini \ - && mkdir /opt/opensim \ - && mv /opt/opensim-tmp/opensim*/* /opt/opensim +RUN apt-get update && \ + apt-get install --no-install-recommends -y libc6-dev libgdiplus libsqlite3-0 screen uuid-runtime && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* -COPY defaults /opt/opensim/bin/defaults +COPY --from=build /app /opt/opensim EXPOSE 9000 diff --git a/build/latest/Dockerfile.source b/build/latest/Dockerfile.source deleted file mode 100644 index 5972820..0000000 --- a/build/latest/Dockerfile.source +++ /dev/null @@ -1,45 +0,0 @@ - -ARG DOTNET_VERSION=8.0 -FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS build - -ARG OPENSIM_VERSION=0.9.3.0 - -# Cache Bust to avoid caching skipping the latest commit -ADD https://api.github.com/repos/opensim/opensim/git/refs/heads/${OPENSIM_VERSION} version.json -RUN git clone --depth 1 --branch "${OPENSIM_VERSION}" https://github.com/opensim/opensim.git /app -WORKDIR /app -RUN rm -rf .git && \ - ./runprebuild.sh && \ - ./compile.sh && \ - find . -name "*.pdb" -delete && \ - rm -r -- *prebuild* compile.sh ThirdParty TESTING.txt Prebuild OpenSim* Makefile BUILDING.md && \ - rm bin/config-include/storage/SQLiteStandalone.ini -COPY defaults bin/defaults - -FROM mcr.microsoft.com/dotnet/runtime:${DOTNET_VERSION} - -ARG OPENSIM_VERSION=0.9.3.0 - -LABEL \ - org.opencontainers.image.title="OpenSimulator (unofficial)" \ - org.opencontainers.image.authors="code@soupbowl.io" \ - org.opencontainers.image.source="https://github.com/soup-bowl/opensimulator-docker" \ - org.opencontainers.image.licenses="MIT" \ - org.opencontainers.image.version="${OPENSIM_VERSION}" - -# hadolint ignore=DL3008 -RUN apt-get update && \ - apt-get install --no-install-recommends -y libc6-dev libgdiplus libsqlite3-dev uuid-runtime && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -COPY --from=build /app /opt/opensim - -EXPOSE 9000 - -WORKDIR /opt/opensim/bin - -COPY docker-entrypoint.sh /usr/local/bin/ - -ENTRYPOINT ["docker-entrypoint.sh"] -CMD [ "dotnet", "OpenSim.dll", "-console=basic" ] diff --git a/docker-compose.yml b/docker-compose.yml index 7ba4ff4..4b5e089 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: container_name: opensim build: context: ./build/latest - dockerfile: Dockerfile.source + dockerfile: Dockerfile args: - OPENSIM_VERSION=master depends_on: