Skip to content

Commit

Permalink
Use docker compress for image. v5.11.16
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Nov 11, 2023
1 parent 092d1de commit 30f7bdd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/focal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: |
echo "Release ossrs/srs-stack:$SRS_TAG"
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64/v8 \
--output "type=image,push=true" \
--output "type=image,push=true" --compress \
--tag ossrs/srs-stack:$SRS_TAG -f focal/Dockerfile .
- name: Docker alias images for ossrs/srs-stack
uses: akhilerm/tag-push-action@v2.1.0
Expand Down
9 changes: 7 additions & 2 deletions focal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ FROM ${ARCH}goacme/lego AS lego
# https://github.com/upx/upx
FROM ${ARCH}ubuntu:focal AS upx

ARG BUILDPLATFORM
ARG TARGETPLATFORM
ARG TARGETARCH
RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM, TARGETARCH: $TARGETARCH"

# 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
Expand All @@ -16,13 +21,13 @@ COPY --from=lego /lego /usr/local/bin/
COPY --from=build /usr/local/bin/ffmpeg /usr/local/bin/ffprobe /usr/local/bin/
COPY --from=redis /usr/local/bin/redis-cli /usr/local/bin/redis-server /usr/local/bin/

RUN echo "Before UPX" && ls -lh /usr/local/bin && \
RUN echo "Before UPX for $TARGETARCH" && ls -lh /usr/local/bin && \
upx --best --lzma /usr/local/bin/lego && \
upx --best --lzma /usr/local/bin/ffmpeg && \
upx --best --lzma /usr/local/bin/ffprobe && \
upx --best --lzma /usr/local/bin/redis-cli && \
upx --best --lzma /usr/local/bin/redis-server && \
echo "After UPX" && ls -lh /usr/local/bin
echo "After UPX for $TARGETARCH" && ls -lh /usr/local/bin

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

0 comments on commit 30f7bdd

Please sign in to comment.