Skip to content

Commit

Permalink
Refine the base focal image. v1.0.304
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Aug 10, 2023
1 parent d6d7be8 commit 6fec5b9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
6 changes: 6 additions & 0 deletions auto/focal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ echo "BASH_SOURCE=${BASH_SOURCE}, REALPATH=${REALPATH}, SCRIPT_DIR=${SCRIPT_DIR}
cd ${WORK_DIR}

help=no
refresh=no

while [[ "$#" -gt 0 ]]; do
case $1 in
-h|--help) help=yes; shift ;;
-refresh|--refresh) refresh=yes; shift ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
done
Expand All @@ -20,12 +22,16 @@ if [[ "$help" == yes ]]; then
echo "Usage: $0 [OPTIONS]"
echo "Options:"
echo " -h, --help Show this help message and exit"
echo " -refresh, --refresh Refresh current tag. Default: no"
exit 0
fi

RELEASE=$(git describe --tags --abbrev=0 --match focal-*)
REVISION=$(echo $RELEASE|awk -F . '{print $3}')
let NEXT=$REVISION+1
if [[ $refresh == yes && $REVISION != "-1" ]]; then
let NEXT=$REVISION
fi
echo "Last release is $RELEASE, revision is $REVISION, next is $NEXT"

VERSION="1.0.$NEXT"
Expand Down
30 changes: 16 additions & 14 deletions focal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,29 @@ FROM ${ARCH}ossrs/srs:ubuntu20 AS build
FROM ${ARCH}redis:5.0 AS redis
FROM ${ARCH}goacme/lego AS lego

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

COPY --from=build /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
COPY --from=build /usr/local/bin/ffprobe /usr/local/bin/ffprobe
# For HTTPS client, or failed as: x509: certificate signed by unknown authority
FROM ${ARCH}ubuntu:focal AS files

# 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 /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
# For redis server and tools.
COPY --from=redis /usr/local/bin/redis-cli /usr/local/bin/redis-cli
COPY --from=redis /usr/local/bin/redis-server /usr/local/bin/redis-server
# For ACME client, request and renew the HTTPS certificate.
COPY --from=lego /lego /usr/local/bin/lego
COPY --from=redis /usr/local/bin/redis-cli /usr/local/bin/redis-server /usr/local/bin/
COPY --from=lego /lego /usr/local/bin/

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

COPY --from=files /usr/local /usr/local
COPY --from=files /usr/share /usr/share
COPY --from=files /etc/ssl /etc/ssl

# We write the common config for platform to base image, however you can
# overwrite it if not for platform, for example, used in releases.
ENV PORT=":2024" NODE_ENV=production SRS_DOCKERIZED=true MGMT_DOCKER=true PLATFORM_DOCKER=true CLOUD=DOCKER

# Create link for compatible reason.
RUN mkdir -p /usr/local/lighthouse/softwares && \
ln -sf /usr/local/srs-cloud /usr/local/lighthouse/softwares/srs-cloud

# Setup the work directory to platform.
WORKDIR /usr/local/srs-cloud/platform

0 comments on commit 6fec5b9

Please sign in to comment.