2
0
mirror of https://github.com/spritsail/plex-media-server.git synced 2025-07-09 17:10:56 +00:00

Build Plex on musl, from scratch

Plex now provide a first-party musl Plex build that works without any
external dependencies whatsoever. It's built with LLVM with many
compiler and linker optimisations enabled:
https://forums.plex.tv/t/plex-media-server-forum-preview-faster-and-smaller-builds-with-new-toolchain/699575

Changes for this release include:
- Drop curl, OpenSSL and zlib; they're no longer required. libcurl and
  libssl/libcrypto are provided by Plex anyway.
- Build `FROM spritsail/alpine` instead of `FROM debian` to ensure musl
  compatibility with all compiled binaries. Use `FROM scratch` for the
  resulting image. ld-musl is provided by Plex.
- Build busybox, su-exec and tini as they're no longer provided by the
  base image.
- Build binaries/libraries with standard hardening flags, including the
  popular -flto.

Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
2021-03-13 16:17:21 +00:00
parent f8aef5f2d1
commit 32734c3aa0
4 changed files with 102 additions and 180 deletions

View File

@ -2,12 +2,6 @@
kind: pipeline
name: build-amd64
trigger:
event:
- push
- pull_request
- tag
platform:
os: linux
arch: amd64
@ -24,7 +18,7 @@ steps:
image: spritsail/docker-test
settings:
run: |
curl --version &&
busybox && \
xmlstarlet --version
- name: test
@ -44,65 +38,15 @@ steps:
settings:
repo: spritsail/plex-media-server
tags:
- latest
- "%label io.spritsail.version.plex | %remsuf [0-9a-f]+$ | %auto 2"
username: {from_secret: docker_username}
password: {from_secret: docker_password}
- musl
login: {from_secret: docker_login}
when:
branch:
- master
- musl
event:
- push
---
kind: pipeline
name: update-readme
steps:
- name: dockerhub-readme
pull: always
image: jlesage/drone-push-readme
settings:
username: {from_secret: docker_username}
password: {from_secret: docker_password}
repo: spritsail/plex-media-server
when:
branch:
- master
- pass
event:
- push
---
kind: pipeline
name: update-cron
trigger:
event:
- cron
platform:
os: linux
arch: amd64
steps:
- name: update
pull: always
image: spritsail/alpine
commands:
- apk add bash curl jq git
- ./update.sh
- name: push
pull: always
image: appleboy/drone-git-push
settings:
branch: master
remote: git@github.com:spritsail/plex-media-server.git
ssh_key: {from_secret: git_ssh_key}
---
kind: signature
hmac: ffa33c4e8d4d71e4a1dcbc850859ebde679f6c574885d99df3ca9496e1db55b9
hmac: 63bede647ba8e4f4f0a69983c22535fbda0afa811b60830c31edb0fbbf0b8b86
...