Skip to content

Commit 48b3275

Browse files
YedPoolclaude
andcommitted
Fix LiveKit binary download to use correct tar.gz format
- Use GitHub API to get latest version dynamically - Download livekit_VERSION_linux_ARCH.tar.gz instead of standalone binary - Extract tar.gz and find livekit-server binary inside - Clean up extracted files after installation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8f4a1ad commit 48b3275

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

livekit-server/Dockerfile

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,28 @@ RUN echo "System info:" && \
3232
else \
3333
echo "Unsupported architecture: $arch"; exit 1; \
3434
fi && \
35-
download_url="https://github.com/livekit/livekit/releases/latest/download/livekit-server_linux_${binary_arch}" && \
35+
# Get latest version for proper filename
36+
latest_version=$(curl -s https://api.github.com/repos/livekit/livekit/releases/latest | grep '"tag_name"' | cut -d'"' -f4) && \
37+
echo "Latest LiveKit version: $latest_version" && \
38+
download_url="https://github.com/livekit/livekit/releases/download/${latest_version}/livekit_${latest_version#v}_linux_${binary_arch}.tar.gz" && \
3639
echo "Downloading LiveKit server from: $download_url" && \
37-
curl -L -f --retry 3 --retry-delay 2 "$download_url" -o /usr/local/bin/livekit-server && \
38-
echo "Download completed, validating..." && \
40+
curl -L -f --retry 3 --retry-delay 2 "$download_url" -o /tmp/livekit.tar.gz && \
41+
echo "Download completed, extracting..." && \
42+
cd /tmp && \
43+
tar -xzf livekit.tar.gz && \
44+
ls -la /tmp/ && \
45+
# Find the livekit-server binary in extracted files
46+
find /tmp -name "livekit-server" -type f && \
47+
cp $(find /tmp -name "livekit-server" -type f) /usr/local/bin/livekit-server && \
48+
chmod +x /usr/local/bin/livekit-server && \
49+
echo "Binary installation completed, validating..." && \
3950
ls -la /usr/local/bin/livekit-server && \
4051
file_size=$(stat -c%s /usr/local/bin/livekit-server) && \
4152
echo "File size: $file_size bytes" && \
42-
if [ "$file_size" -lt 1000000 ]; then \
43-
echo "ERROR: Downloaded file is too small ($file_size bytes), likely an error page" && \
44-
echo "File contents:" && \
45-
head -c 500 /usr/local/bin/livekit-server && \
46-
exit 1; \
47-
fi && \
4853
file /usr/local/bin/livekit-server && \
49-
chmod +x /usr/local/bin/livekit-server && \
5054
echo "Binary validation successful" && \
51-
ldd /usr/local/bin/livekit-server || echo "ldd failed - static binary or missing dependencies"
55+
ldd /usr/local/bin/livekit-server || echo "ldd failed - static binary or missing dependencies" && \
56+
rm -rf /tmp/livekit.tar.gz /tmp/livekit_*
5257

5358
# Create directory for config files
5459
RUN mkdir -p /tmp

0 commit comments

Comments
 (0)