mirror of
https://gh.con.sh/https://github.com/plexinc/pms-docker
synced 2024-09-20 06:45:31 +00:00
feat: merge the amd64 and arm dockerfiles together to be built from the same file (#107)
This commit is contained in:
parent
108466f2a8
commit
fa160869bf
59
Dockerfile
59
Dockerfile
|
@ -1,14 +1,23 @@
|
||||||
FROM ubuntu:20.04
|
FROM ubuntu:20.04
|
||||||
|
|
||||||
ARG S6_OVERLAY_VERSION=v2.2.0.3
|
ARG TARGETARCH
|
||||||
ARG S6_OVERLAY_ARCH=amd64
|
ARG TARGETPLATFORM
|
||||||
ARG PLEX_BUILD=linux-x86_64
|
|
||||||
ARG PLEX_DISTRO=debian
|
|
||||||
ARG DEBIAN_FRONTEND="noninteractive"
|
ARG DEBIAN_FRONTEND="noninteractive"
|
||||||
ENV TERM="xterm" LANG="C.UTF-8" LC_ALL="C.UTF-8"
|
ENV TERM="xterm" LANG="C.UTF-8" LC_ALL="C.UTF-8"
|
||||||
|
|
||||||
ENTRYPOINT ["/init"]
|
ENTRYPOINT ["/init"]
|
||||||
|
|
||||||
|
# Add user
|
||||||
|
RUN useradd -U -d /config -s /bin/false plex && \
|
||||||
|
usermod -G users plex && \
|
||||||
|
\
|
||||||
|
# Setup directories
|
||||||
|
mkdir -p \
|
||||||
|
/config \
|
||||||
|
/transcode \
|
||||||
|
/data
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
# Update and get dependencies
|
# Update and get dependencies
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
|
@ -17,29 +26,24 @@ RUN \
|
||||||
curl \
|
curl \
|
||||||
xmlstarlet \
|
xmlstarlet \
|
||||||
uuid-runtime \
|
uuid-runtime \
|
||||||
unrar \
|
unrar && \
|
||||||
&& \
|
apt-get -y autoremove && \
|
||||||
\
|
apt-get -y clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Fetch and extract S6 overlay
|
# Fetch and extract S6 overlay
|
||||||
|
ARG S6_OVERLAY_VERSION=v2.2.0.3
|
||||||
|
RUN if [ "${TARGETPLATFORM}" = 'linux/arm/v7' ]; then \
|
||||||
|
S6_OVERLAY_ARCH='armhf'; \
|
||||||
|
elif [ "${TARGETARCH}" = 'amd64' ]; then \
|
||||||
|
S6_OVERLAY_ARCH='amd64'; \
|
||||||
|
elif [ "${TARGETARCH}" = 'arm64' ]; then \
|
||||||
|
S6_OVERLAY_ARCH='aarch64'; \
|
||||||
|
fi \
|
||||||
|
&& \
|
||||||
curl -J -L -o /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz && \
|
curl -J -L -o /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz && \
|
||||||
tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C / --exclude='./bin' && \
|
tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C / --exclude='./bin' && \
|
||||||
tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C /usr ./bin && \
|
tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C /usr ./bin && \
|
||||||
\
|
|
||||||
# Add user
|
|
||||||
useradd -U -d /config -s /bin/false plex && \
|
|
||||||
usermod -G users plex && \
|
|
||||||
\
|
|
||||||
# Setup directories
|
|
||||||
mkdir -p \
|
|
||||||
/config \
|
|
||||||
/transcode \
|
|
||||||
/data \
|
|
||||||
&& \
|
|
||||||
\
|
|
||||||
# Cleanup
|
|
||||||
apt-get -y autoremove && \
|
|
||||||
apt-get -y clean && \
|
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
|
||||||
rm -rf /tmp/* && \
|
rm -rf /tmp/* && \
|
||||||
rm -rf /var/tmp/*
|
rm -rf /var/tmp/*
|
||||||
|
|
||||||
|
@ -49,13 +53,12 @@ VOLUME /config /transcode
|
||||||
ENV CHANGE_CONFIG_DIR_OWNERSHIP="true" \
|
ENV CHANGE_CONFIG_DIR_OWNERSHIP="true" \
|
||||||
HOME="/config"
|
HOME="/config"
|
||||||
|
|
||||||
ARG TAG=beta
|
|
||||||
ARG URL=
|
|
||||||
|
|
||||||
COPY root/ /
|
COPY root/ /
|
||||||
|
|
||||||
RUN \
|
|
||||||
# Save version and install
|
# Save version and install
|
||||||
/installBinary.sh
|
ARG PLEX_DISTRO=debian
|
||||||
|
ARG TAG=beta
|
||||||
|
ARG URL=
|
||||||
|
RUN /installBinary.sh
|
||||||
|
|
||||||
HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD /healthcheck.sh || exit 1
|
HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD /healthcheck.sh || exit 1
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
FROM ubuntu:20.04
|
|
||||||
|
|
||||||
ARG S6_OVERLAY_VERSION=v2.2.0.3
|
|
||||||
ARG S6_OVERLAY_ARCH=aarch64
|
|
||||||
ARG PLEX_BUILD=linux-aarch64
|
|
||||||
ARG PLEX_DISTRO=debian
|
|
||||||
ARG DEBIAN_FRONTEND="noninteractive"
|
|
||||||
ENV TERM="xterm" LANG="C.UTF-8" LC_ALL="C.UTF-8"
|
|
||||||
|
|
||||||
ENTRYPOINT ["/init"]
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
# Update and get dependencies
|
|
||||||
apt-get update && \
|
|
||||||
apt-get install -y \
|
|
||||||
tzdata \
|
|
||||||
curl \
|
|
||||||
xmlstarlet \
|
|
||||||
uuid-runtime \
|
|
||||||
unrar \
|
|
||||||
&& \
|
|
||||||
\
|
|
||||||
# Fetch and extract S6 overlay
|
|
||||||
curl -J -L -o /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz && \
|
|
||||||
tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C / --exclude='./bin' && \
|
|
||||||
tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C /usr ./bin && \
|
|
||||||
\
|
|
||||||
# Add user
|
|
||||||
useradd -U -d /config -s /bin/false plex && \
|
|
||||||
usermod -G users plex && \
|
|
||||||
\
|
|
||||||
# Setup directories
|
|
||||||
mkdir -p \
|
|
||||||
/config \
|
|
||||||
/transcode \
|
|
||||||
/data \
|
|
||||||
&& \
|
|
||||||
\
|
|
||||||
# Cleanup
|
|
||||||
apt-get -y autoremove && \
|
|
||||||
apt-get -y clean && \
|
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
|
||||||
rm -rf /tmp/* && \
|
|
||||||
rm -rf /var/tmp/*
|
|
||||||
|
|
||||||
EXPOSE 32400/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414/udp
|
|
||||||
VOLUME /config /transcode
|
|
||||||
|
|
||||||
ENV CHANGE_CONFIG_DIR_OWNERSHIP="true" \
|
|
||||||
HOME="/config"
|
|
||||||
|
|
||||||
ARG TAG=beta
|
|
||||||
ARG URL=
|
|
||||||
|
|
||||||
COPY root/ /
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
# Save version and install
|
|
||||||
/installBinary.sh
|
|
||||||
|
|
||||||
HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD /healthcheck.sh || exit 1
|
|
|
@ -1,61 +0,0 @@
|
||||||
FROM ubuntu:20.04
|
|
||||||
|
|
||||||
ARG S6_OVERLAY_VERSION=v2.2.0.3
|
|
||||||
ARG S6_OVERLAY_ARCH=armhf
|
|
||||||
ARG PLEX_BUILD=linux-armv7hf_neon
|
|
||||||
ARG PLEX_DISTRO=debian
|
|
||||||
ARG DEBIAN_FRONTEND="noninteractive"
|
|
||||||
ENV TERM="xterm" LANG="C.UTF-8" LC_ALL="C.UTF-8"
|
|
||||||
|
|
||||||
ENTRYPOINT ["/init"]
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
# Update and get dependencies
|
|
||||||
apt-get update && \
|
|
||||||
apt-get install -y \
|
|
||||||
tzdata \
|
|
||||||
curl \
|
|
||||||
xmlstarlet \
|
|
||||||
uuid-runtime \
|
|
||||||
unrar \
|
|
||||||
&& \
|
|
||||||
\
|
|
||||||
# Fetch and extract S6 overlay
|
|
||||||
curl -J -L -o /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz && \
|
|
||||||
tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C / --exclude='./bin' && \
|
|
||||||
tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C /usr ./bin && \
|
|
||||||
\
|
|
||||||
# Add user
|
|
||||||
useradd -U -d /config -s /bin/false plex && \
|
|
||||||
usermod -G users plex && \
|
|
||||||
\
|
|
||||||
# Setup directories
|
|
||||||
mkdir -p \
|
|
||||||
/config \
|
|
||||||
/transcode \
|
|
||||||
/data \
|
|
||||||
&& \
|
|
||||||
\
|
|
||||||
# Cleanup
|
|
||||||
apt-get -y autoremove && \
|
|
||||||
apt-get -y clean && \
|
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
|
||||||
rm -rf /tmp/* && \
|
|
||||||
rm -rf /var/tmp/*
|
|
||||||
|
|
||||||
EXPOSE 32400/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414/udp
|
|
||||||
VOLUME /config /transcode
|
|
||||||
|
|
||||||
ENV CHANGE_CONFIG_DIR_OWNERSHIP="true" \
|
|
||||||
HOME="/config"
|
|
||||||
|
|
||||||
ARG TAG=beta
|
|
||||||
ARG URL=
|
|
||||||
|
|
||||||
COPY root/ /
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
# Save version and install
|
|
||||||
/installBinary.sh
|
|
||||||
|
|
||||||
HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD /healthcheck.sh || exit 1
|
|
|
@ -2,6 +2,15 @@
|
||||||
|
|
||||||
. /plex-common.sh
|
. /plex-common.sh
|
||||||
|
|
||||||
|
PLEX_BUILD=''
|
||||||
|
if [ "${TARGETPLATFORM}" = 'linux/arm/v7' ]; then
|
||||||
|
PLEX_BUILD='linux-armv7hf_neon'
|
||||||
|
elif [ "${TARGETARCH}" = 'amd64' ]; then
|
||||||
|
PLEX_BUILD='linux-x86_64';
|
||||||
|
elif [ "${TARGETARCH}" = 'arm64' ]; then
|
||||||
|
PLEX_BUILD='aarch64' ;
|
||||||
|
fi
|
||||||
|
|
||||||
addVarToConf "version" "${TAG}"
|
addVarToConf "version" "${TAG}"
|
||||||
addVarToConf "plex_build" "${PLEX_BUILD}"
|
addVarToConf "plex_build" "${PLEX_BUILD}"
|
||||||
addVarToConf "plex_distro" "${PLEX_DISTRO}"
|
addVarToConf "plex_distro" "${PLEX_DISTRO}"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user