Live video on the AT Protocol
1# syntax=docker/dockerfile:1
2FROM ubuntu:22.04 AS builder-no-darwin
3
4ARG TARGETARCH
5ENV TARGETARCH $TARGETARCH
6
7ARG DOCKERFILE_HASH
8ENV DOCKERFILE_HASH $DOCKERFILE_HASH
9
10ENV GO_VERSION 1.25.1
11ENV NODE_VERSION 22.15.0
12ENV DEBIAN_FRONTEND noninteractive
13
14ADD docker/sources.list /etc/apt/sources.list
15ADD docker/winehq.key /etc/apt/keyrings/winehq-archive.key
16ADD docker/llvm-snapshot.key /etc/apt/keyrings/llvm-snapshot.key
17
18RUN dpkg --add-architecture i386 && dpkg --add-architecture arm64
19
20# Haven't automated it yet, so here's my instructors for mirroring winehq:
21# /etc/apt/mirror.list:
22# deb-i386 https://dl.winehq.org/wine-builds/ubuntu jammy main
23# deb-all https://dl.winehq.org/wine-builds/ubuntu jammy main
24# deb-amd64 [arch=amd64,i386 signed-by=/etc/apt/keyrings/winehq-archive.key] https://dl.winehq.org/wine-builds/ubuntu jammy main
25#
26# go install github.com/minio/mc@latest
27# mc alias set streamplace-crap https://storage.googleapis.com/ ACCESS_KEY SECRET_KEY
28# apt-mirror
29# mc mirror --overwrite /var/spool/apt-mirror/mirror/dl.winehq.org/ streamplace-crap/streamplace-crap/dl.winehq.org/
30
31RUN apt update \
32 && apt install -y build-essential curl git openjdk-17-jdk unzip jq g++ python3-pip ninja-build \
33 gcc-aarch64-linux-gnu g++-aarch64-linux-gnu qemu-user-static pkg-config \
34 nasm gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64-tools zip bison flex expect \
35 mono-runtime nuget mono-xsp4 squashfs-tools \
36 libc6:arm64 libstdc++6:arm64 \
37 cmake libssl-dev libssl-dev:arm64 \
38 ruby-rubygems postgresql sudo \
39 && pip install meson tomli \
40 && curl -L --fail https://go.dev/dl/go$GO_VERSION.linux-$TARGETARCH.tar.gz -o go.tar.gz \
41 && tar -C /usr/local -xf go.tar.gz \
42 && rm go.tar.gz
43
44RUN echo 'deb [arch=amd64,i386 signed-by=/etc/apt/keyrings/winehq-archive.key] https://storage.googleapis.com/streamplace-crap/dl.winehq.org/wine-builds/ubuntu/ jammy main' >> /etc/apt/sources.list \
45 && echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/llvm-snapshot.key] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-21 main' >> /etc/apt/sources.list \
46 && apt update \
47 && apt install -y --install-recommends winehq-stable \
48 clang-21 lldb-21 lld-21 clangd-21
49
50ENV PATH /usr/lib/llvm-21/bin:$PATH:/usr/local/go/bin:/root/go/bin:/root/.cargo/bin
51
52RUN export NODEARCH="$TARGETARCH" \
53 && if [ "$TARGETARCH" = "amd64" ]; then export NODEARCH="x64"; fi \
54 && curl -L --fail https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$NODEARCH.tar.xz -o node.tar.gz \
55 && tar -xf node.tar.gz \
56 && cp -r node-v$NODE_VERSION-linux-$NODEARCH/* /usr/local \
57 && rm -rf node.tar.gz node-v$NODE_VERSION-linux-$NODEARCH
58
59RUN npm install -g corepack@latest
60
61ARG ANDROID_SDK_VERSION=11076708
62ENV ANDROID_HOME /opt/android-sdk
63RUN mkdir -p ${ANDROID_HOME}/cmdline-tools && \
64 curl -L -O https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip && \
65 unzip *tools*linux*.zip -d ${ANDROID_HOME}/cmdline-tools && \
66 mv ${ANDROID_HOME}/cmdline-tools/cmdline-tools ${ANDROID_HOME}/cmdline-tools/tools && \
67 rm *tools*linux*.zip && \
68 curl -L https://raw.githubusercontent.com/thyrlian/AndroidSDK/bfcbf0cdfd6bb1ef45579e6ddc4d3876264cbdd1/android-sdk/license_accepter.sh | bash
69
70RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh \
71 && bash rustup.sh -y \
72 && rustup target add aarch64-unknown-linux-gnu \
73 && rustup target add x86_64-unknown-linux-gnu \
74 && rustup target add x86_64-pc-windows-gnu \
75 && rustup target add x86_64-apple-darwin \
76 && rustup target add aarch64-apple-darwin \
77 && rm rustup.sh
78
79RUN go env -w GOTOOLCHAIN=go$GO_VERSION
80
81# FROM builder AS cached-builder
82# ARG CI_COMMIT_BRANCH=next
83# ENV CI_COMMIT_BRANCH $CI_COMMIT_BRANCH
84# WORKDIR /cached-build
85# RUN git clone https://git.stream.place/streamplace/streamplace \
86# && cd streamplace \
87# && make version install check app android -j$(nproc) \
88# && make node \
89# && cd .. \
90# && rm -rf streamplace
91
92RUN curl -L https://github.com/golangci/golangci-lint/releases/download/v2.5.0/golangci-lint-2.5.0-linux-amd64.tar.gz -o golangci-lint.tar.gz \
93 && tar -xf golangci-lint.tar.gz \
94 && mv golangci-lint-2.5.0-linux-amd64/golangci-lint /usr/local/bin/ \
95 && rm -rf golangci-lint.tar.gz golangci-lint-2.5.0-linux-amd64
96
97RUN gem install fpm
98ENV APTLY_VERSION 1.6.2
99RUN curl --fail -L https://github.com/aptly-dev/aptly/releases/download/v${APTLY_VERSION}/aptly_${APTLY_VERSION}_linux_amd64.zip -o aptly.zip \
100 && unzip aptly.zip \
101 && mv aptly_${APTLY_VERSION}_linux_amd64/aptly /usr/local/bin/ \
102 && rm -rf aptly.zip aptly_${APTLY_VERSION}_linux_amd64
103
104ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=false
105ENV STREAMPLACE_TEST_POSTGRES_COMMAND="sudo -u postgres /usr/lib/postgresql/14/bin/postgres -D /etc/postgresql/14/main/"
106ENV STREAMPLACE_TEST_POSTGRES_URL="postgresql://postgres:postgres@localhost:5432/streamplace"
107# allow all postgres connections
108RUN bash -c 'echo -en "local all postgres peer\nhost all all 0.0.0.0/0 trust\n" > /etc/postgresql/14/main/pg_hba.conf'
109
110FROM builder-no-darwin AS builder
111
112WORKDIR /osxcross
113
114RUN git clone https://github.com/tpoechtrager/osxcross.git .
115# RUN UNATTENDED=1 ./build_apple_clang.sh
116ENV MAC_SDK_VERSION 15.4
117RUN curl -L --fail https://github.com/joseluisq/macosx-sdks/releases/download/$MAC_SDK_VERSION/MacOSX$MAC_SDK_VERSION.sdk.tar.xz -o /osxcross/tarballs/MacOSX$MAC_SDK_VERSION.sdk.tar.xz
118RUN UNATTENDED=1 ./build.sh
119RUN cargo install apple-codesign
120ENV PATH /osxcross/target/bin:$PATH
121
122LABEL org.opencontainers.image.authors="support@stream.place"