[docker] Switch most docker images used in CI to the iceshrimp.dev repo
This commit is contained in:
parent
70f822ab3d
commit
9e4ccabf87
11 changed files with 23 additions and 21 deletions
6
.docker/build.sh
Executable file
6
.docker/build.sh
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
docker build . -f dotnet-sdk-8.0-wasm.Dockerfile -t iceshrimp.dev/iceshrimp/dotnet-sdk:8.0-wasm --push
|
||||||
|
docker build . -f dotnet-sdk-8.0-alpine.Dockerfile -t iceshrimp.dev/iceshrimp/dotnet-sdk:8.0-alpine --push
|
||||||
|
docker build . -f dotnet-sdk-9.0-alpine-wasm.Dockerfile -t iceshrimp.dev/iceshrimp/dotnet-sdk:9.0-alpine-wasm --push
|
||||||
|
docker build . -f ci-env.Dockerfile -t iceshrimp.dev/iceshrimp/ci-env:dotnet --push
|
||||||
|
docker build . -f ci-env-wasm.Dockerfile -t iceshrimp.dev/iceshrimp/ci-env:dotnet-wasm --push
|
|
@ -1,11 +1,8 @@
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:8.0
|
FROM iceshrimp.dev/iceshrimp/dotnet-sdk:8.0-wasm
|
||||||
RUN apt-get update && apt-get install git bash python3 curl golang nodejs zstd ca-certificates -y
|
RUN apt-get update && apt-get install git bash python3 curl golang nodejs zstd ca-certificates -y
|
||||||
RUN install -m 0755 -d /etc/apt/keyrings
|
RUN install -m 0755 -d /etc/apt/keyrings
|
||||||
RUN curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
|
RUN curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
|
||||||
RUN chmod a+r /etc/apt/keyrings/docker.asc
|
RUN chmod a+r /etc/apt/keyrings/docker.asc
|
||||||
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
RUN apt-get update && apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin -y
|
RUN apt-get update && apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin -y
|
||||||
RUN curl -o /bin/git-restore-mtime https://raw.githubusercontent.com/MestreLion/git-tools/main/git-restore-mtime
|
|
||||||
RUN chmod +x /bin/git-restore-mtime
|
|
||||||
RUN dotnet workload install wasm-tools
|
|
||||||
CMD ["/bin/sh"]
|
CMD ["/bin/sh"]
|
|
@ -1,5 +1,3 @@
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine
|
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine
|
||||||
RUN apk add --no-cache --no-progress git docker bash python3 curl go nodejs-current zstd
|
RUN apk add --no-cache --no-progress git docker bash python3 curl go nodejs-current zstd
|
||||||
RUN curl -o /bin/git-restore-mtime https://raw.githubusercontent.com/MestreLion/git-tools/main/git-restore-mtime
|
|
||||||
RUN chmod +x /bin/git-restore-mtime
|
|
||||||
CMD ["/bin/sh"]
|
CMD ["/bin/sh"]
|
|
@ -1,4 +1,4 @@
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled AS image-aot
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY linux-$TARGETARCH/ .
|
COPY linux-$TARGETARCH/ .
|
2
.docker/dotnet-sdk-8.0-alpine.Dockerfile
Normal file
2
.docker/dotnet-sdk-8.0-alpine.Dockerfile
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine
|
||||||
|
CMD ["/bin/sh"]
|
4
.docker/dotnet-sdk-8.0-wasm.Dockerfile
Normal file
4
.docker/dotnet-sdk-8.0-wasm.Dockerfile
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:8.0
|
||||||
|
RUN --mount=type=cache,target=/root/.nuget dotnet workload install wasm-tools
|
||||||
|
RUN apt-get update && apt-get install python3 -y
|
||||||
|
CMD ["/bin/sh"]
|
2
.docker/dotnet-sdk-9.0-alpine-wasm.Dockerfile
Normal file
2
.docker/dotnet-sdk-9.0-alpine-wasm.Dockerfile
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:9.0-preview-alpine
|
||||||
|
RUN dotnet workload install wasm-tools
|
|
@ -6,7 +6,7 @@ jobs:
|
||||||
test-build-and-push:
|
test-build-and-push:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: iceshrimp.dev/iceshrimp/iceshrimp.net:ci-env
|
image: iceshrimp.dev/iceshrimp/ci-env:dotnet
|
||||||
options: |
|
options: |
|
||||||
--volume /opt/iceshrimp-cache/nuget:/root/.nuget
|
--volume /opt/iceshrimp-cache/nuget:/root/.nuget
|
||||||
--volume /root/.docker:/root/.docker
|
--volume /root/.docker:/root/.docker
|
||||||
|
@ -28,10 +28,7 @@ jobs:
|
||||||
- name: Initialize builder
|
- name: Initialize builder
|
||||||
run: docker buildx use iceshrimp-ci || docker buildx create --name iceshrimp-ci --use
|
run: docker buildx use iceshrimp-ci || docker buildx create --name iceshrimp-ci --use
|
||||||
- name: Patch Dockerfile
|
- name: Patch Dockerfile
|
||||||
run: |
|
run: sed -i 's^mcr.microsoft.com/dotnet/sdk:8.0-alpine^iceshrimp.dev/iceshrimp/dotnet-sdk:8.0-alpine^g' /iceshrimp/Dockerfile
|
||||||
sed -i 's^mcr.microsoft.com/dotnet/sdk:8.0-alpine^iceshrimp.dev/iceshrimp/iceshrimp.net:ci-env^g' /iceshrimp/Dockerfile
|
|
||||||
sed -i 's^mcr.microsoft.com/dotnet/sdk:8.0^iceshrimp.dev/iceshrimp/iceshrimp.net:ci-env-wasm^g' /iceshrimp/Dockerfile
|
|
||||||
sed -i 's^dotnet workload install wasm-tools^echo^g' /iceshrimp/Dockerfile
|
|
||||||
- name: Build the image
|
- name: Build the image
|
||||||
shell: bash
|
shell: bash
|
||||||
run: docker buildx build --target image-jit -t iceshrimp.dev/${GITHUB_REPOSITORY@L}:$GITHUB_REF_NAME --provenance=false --platform=linux/amd64,linux/arm64 --push /iceshrimp
|
run: docker buildx build --target image-jit -t iceshrimp.dev/${GITHUB_REPOSITORY@L}:$GITHUB_REF_NAME --provenance=false --platform=linux/amd64,linux/arm64 --push /iceshrimp
|
||||||
|
|
|
@ -6,7 +6,7 @@ jobs:
|
||||||
build-artifacts:
|
build-artifacts:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: iceshrimp.dev/iceshrimp/iceshrimp.net:ci-env-wasm
|
image: iceshrimp.dev/iceshrimp/ci-env:dotnet-wasm
|
||||||
options: --volume /opt/iceshrimp-cache/nuget:/root/.nuget
|
options: --volume /opt/iceshrimp-cache/nuget:/root/.nuget
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- name: Clone repository
|
||||||
|
@ -62,7 +62,7 @@ jobs:
|
||||||
- name: Build the image
|
- name: Build the image
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cp /src/.forgejo/ci-release/Dockerfile /out
|
cp /src/.docker/dotnet-runner-8.0.Dockerfile /out/Dockerfile
|
||||||
docker buildx build ${{ env.TAGS }} --provenance=false --platform=linux/amd64,linux/arm64 --push /out
|
docker buildx build ${{ env.TAGS }} --provenance=false --platform=linux/amd64,linux/arm64 --push /out
|
||||||
- name: Purge cache
|
- name: Purge cache
|
||||||
run: docker buildx prune --keep-storage 20G
|
run: docker buildx prune --keep-storage 20G
|
||||||
|
|
|
@ -7,7 +7,7 @@ jobs:
|
||||||
test-build:
|
test-build:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: iceshrimp.dev/iceshrimp/iceshrimp.net:ci-env
|
image: iceshrimp.dev/iceshrimp/dotnet-sdk:8.0-alpine
|
||||||
options: --volume /opt/iceshrimp-cache/nuget:/root/.nuget
|
options: --volume /opt/iceshrimp-cache/nuget:/root/.nuget
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- name: Clone repository
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
# We have to build & run AOT images on linux-glibc, at least until .NET 9.0 (See https://github.com/dotnet/sdk/issues/32327 for details)
|
# We have to build & run AOT images on linux-glibc, at least until .NET 9.0 (See https://github.com/dotnet/sdk/issues/32327 for details)
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS builder-jit
|
FROM --platform=$BUILDPLATFORM iceshrimp.dev/iceshrimp/dotnet-sdk:8.0-alpine AS builder-jit
|
||||||
ARG BUILDPLATFORM
|
ARG BUILDPLATFORM
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
|
@ -40,14 +40,10 @@ RUN --mount=type=cache,target=/root/.nuget \
|
||||||
mv /app-$TARGETARCH /app; else mv /build /app; \
|
mv /app-$TARGETARCH /app; else mv /build /app; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS builder-aot
|
FROM --platform=$BUILDPLATFORM iceshrimp.dev/iceshrimp/dotnet-sdk:8.0-wasm AS builder-aot
|
||||||
ARG BUILDPLATFORM
|
ARG BUILDPLATFORM
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.nuget \
|
|
||||||
dotnet workload install wasm-tools
|
|
||||||
RUN apt-get update && apt-get install python3 -y
|
|
||||||
|
|
||||||
# copy csproj/fsproj & nuget config, then restore as distinct layers
|
# copy csproj/fsproj & nuget config, then restore as distinct layers
|
||||||
COPY NuGet.Config /src
|
COPY NuGet.Config /src
|
||||||
COPY Iceshrimp.Backend/*.csproj /src/Iceshrimp.Backend/
|
COPY Iceshrimp.Backend/*.csproj /src/Iceshrimp.Backend/
|
||||||
|
|
Loading…
Add table
Reference in a new issue