Skip to content

Commit

Permalink
Use upx to make binary smaller. v5.11.16
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Nov 11, 2023
1 parent 336ad12 commit ea6160b
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions focal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,33 @@ ARG ARCH

FROM ${ARCH}ossrs/srs:ubuntu20 AS build
FROM ${ARCH}redis:5.0 AS redis

FROM ${ARCH}goacme/lego AS lego

# https://github.com/upx/upx
FROM ${ARCH}ubuntu:focal AS upx

# https://serverfault.com/questions/949991/how-to-install-tzdata-on-a-ubuntu-docker-image
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && apt-get install -y upx

COPY --from=lego /lego /usr/local/bin/
RUN upx --best --lzma /usr/local/bin/lego

COPY --from=build /usr/local/bin/ffmpeg /usr/local/bin/ffprobe /usr/local/bin/
RUN upx --best --lzma /usr/local/bin/ffmpeg
RUN upx --best --lzma /usr/local/bin/ffprobe

# http://releases.ubuntu.com/focal/
FROM ${ARCH}ubuntu:focal AS dist

# certs: For HTTPS client, or failed as: x509: certificate signed by unknown authority
# redis: For redis server and tools.
# lego: For ACME client, request and renew the HTTPS certificate.
COPY --from=build /usr/local/bin/ffmpeg /usr/local/bin/ffprobe /usr/local/bin/
COPY --from=build /etc/ssl/certs /etc/ssl/certs
COPY --from=build /usr/share/ca-certificates /usr/share/ca-certificates
COPY --from=redis /usr/local/bin/redis-cli /usr/local/bin/redis-server /usr/local/bin/
COPY --from=lego /lego /usr/local/bin/
COPY --from=upx /usr/local/bin/lego /usr/local/bin/ffmpeg /usr/local/bin/ffprobe /usr/local/bin/

# We write the common config for platform to base image, however you can
# overwrite it if not for platform, for example, used in releases.
Expand Down

0 comments on commit ea6160b

Please sign in to comment.