From c75481b83820c7b32a6b835a737f73ffa9f147b8 Mon Sep 17 00:00:00 2001 From: Lukas Herman Date: Tue, 27 Aug 2024 13:26:20 -0400 Subject: [PATCH 1/2] support arm64 variance in install-chrome --- build/chrome/install-chrome | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/chrome/install-chrome b/build/chrome/install-chrome index 703fa670..7f1a13bc 100755 --- a/build/chrome/install-chrome +++ b/build/chrome/install-chrome @@ -1,8 +1,7 @@ #!/bin/bash set -euxo pipefail -if [ "$1" = "linux/arm64" ] -then +if [[ "$1" == linux/arm64* ]]; then apt-get update apt-get install -y \ ca-certificates \ From e8d123578da6729ef1b60db830b9c88911eb23b9 Mon Sep 17 00:00:00 2001 From: Lukas Herman Date: Tue, 27 Aug 2024 15:55:56 -0400 Subject: [PATCH 2/2] allow linux/arm64* builds --- build/egress/Dockerfile | 4 ++-- build/test/Dockerfile | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/egress/Dockerfile b/build/egress/Dockerfile index da29a665..d6e67077 100644 --- a/build/egress/Dockerfile +++ b/build/egress/Dockerfile @@ -19,7 +19,7 @@ ARG TARGETPLATFORM WORKDIR /workspace # install go -RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then GOARCH=arm64; else GOARCH=amd64; fi && \ +RUN if [[ "$TARGETPLATFORM" == linux/arm64* ]]; then GOARCH=arm64; else GOARCH=amd64; fi && \ wget https://go.dev/dl/go1.22.1.linux-${GOARCH}.tar.gz && \ rm -rf /usr/local/go && \ tar -C /usr/local -xzf go1.22.1.linux-${GOARCH}.tar.gz @@ -42,7 +42,7 @@ COPY --from=livekit/egress-templates workspace/build/ cmd/server/templates/ RUN find cmd/server/templates/ -name *.map | xargs rm # build -RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then GOARCH=arm64; else GOARCH=amd64; fi && \ +RUN if [[ "$TARGETPLATFORM" == linux/arm64* ]]; then GOARCH=arm64; else GOARCH=amd64; fi && \ CGO_ENABLED=1 GOOS=linux GOARCH=${GOARCH} GO111MODULE=on GODEBUG=disablethp=1 go build -a -o egress ./cmd/server FROM livekit/gstreamer:1.22.8-prod diff --git a/build/test/Dockerfile b/build/test/Dockerfile index 391f1586..91949da5 100644 --- a/build/test/Dockerfile +++ b/build/test/Dockerfile @@ -19,7 +19,7 @@ WORKDIR /workspace ARG TARGETPLATFORM # install go -RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then GOARCH=arm64; else GOARCH=amd64; fi && \ +RUN if [[ "$TARGETPLATFORM" == linux/arm64* ]]; then GOARCH=arm64; else GOARCH=amd64; fi && \ wget https://go.dev/dl/go1.22.1.linux-${GOARCH}.tar.gz && \ rm -rf /usr/local/go && \ tar -C /usr/local -xzf go1.22.1.linux-${GOARCH}.tar.gz @@ -41,10 +41,10 @@ COPY --from=livekit/egress-templates workspace/build/ cmd/server/templates/ COPY --from=livekit/egress-templates workspace/build/ test/templates/ # build (service tests will need to launch the handler) -RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then GOARCH=arm64; else GOARCH=amd64; fi && \ +RUN if [[ "$TARGETPLATFORM" == linux/arm64* ]]; then GOARCH=arm64; else GOARCH=amd64; fi && \ CGO_ENABLED=1 GOOS=linux GOARCH=${GOARCH} GO111MODULE=on GODEBUG=disablethp=1 go build -a -o egress ./cmd/server -RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then GOARCH=arm64; else GOARCH=amd64; fi && \ +RUN if [[ "$TARGETPLATFORM" == linux/arm64* ]]; then GOARCH=arm64; else GOARCH=amd64; fi && \ CGO_ENABLED=1 GOOS=linux GOARCH=${GOARCH} GO111MODULE=on go test -c -v -race --tags=integration ./test @@ -66,7 +66,7 @@ RUN apt-get update && \ gstreamer1.0-plugins-base- # install go -RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then GOARCH=arm64; else GOARCH=amd64; fi && \ +RUN if [[ "$TARGETPLATFORM" == linux/arm64* ]]; then GOARCH=arm64; else GOARCH=amd64; fi && \ wget https://go.dev/dl/go1.22.1.linux-${GOARCH}.tar.gz && \ rm -rf /usr/local/go && \ tar -C /usr/local -xzf go1.22.1.linux-${GOARCH}.tar.gz @@ -80,7 +80,7 @@ RUN /chrome-installer/install-chrome "$TARGETPLATFORM" RUN rm -rf /var/lib/apt/lists/* # install rtsp server -RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCH=arm64v8; else ARCH=amd64; fi && \ +RUN if [[ "$TARGETPLATFORM" == linux/arm64* ]]; then ARCH=arm64v8; else ARCH=amd64; fi && \ wget https://github.com/aler9/rtsp-simple-server/releases/download/v0.17.6/rtsp-simple-server_v0.17.6_linux_${ARCH}.tar.gz && \ tar -zxvf rtsp-simple-server_v0.17.6_linux_${ARCH}.tar.gz && \ rm rtsp-simple-server_v0.17.6_linux_${ARCH}.tar.gz