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 2204014
Show file tree
Hide file tree
Showing 2 changed files with 16 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
24 changes: 10 additions & 14 deletions focal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,20 @@ 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
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
# 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/ \
--from=build /usr/local/bin/ffprobe /usr/local/bin/ \
--from=build /etc/ssl/certs /etc/ssl/ \
--from=build /usr/share/ca-certificates /usr/share/ \
--from=redis /usr/local/bin/redis-cli /usr/local/bin/ \
--from=redis /usr/local/bin/redis-server /usr/local/bin/ \
--from=lego /lego /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.
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 2204014

Please sign in to comment.