Skip to content

Commit

Permalink
allow linux/arm64* builds (#766)
Browse files Browse the repository at this point in the history
* support arm64 variance in install-chrome

* allow linux/arm64* builds
  • Loading branch information
lherman-cs authored Aug 28, 2024
1 parent 3afa8c6 commit e155ef0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions build/egress/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ENV TARGETPLATFORM=${TARGETPLATFORM}
WORKDIR /workspace

# install go

RUN wget https://go.dev/dl/go1.22.1.linux-${TARGETARCH}.tar.gz && \
rm -rf /usr/local/go && \
tar -C /usr/local -xzf go1.22.1.linux-${TARGETARCH}.tar.gz
Expand Down
10 changes: 5 additions & 5 deletions build/test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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


Expand All @@ -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
Expand All @@ -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/bluenviron/mediamtx/releases/download/v1.8.1/mediamtx_v1.8.1_linux_${ARCH}.tar.gz && \
tar -zxvf mediamtx_v1.8.1_linux_${ARCH}.tar.gz && \
rm mediamtx_v1.8.1_linux_${ARCH}.tar.gz && \
Expand Down

0 comments on commit e155ef0

Please sign in to comment.