Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Autoupdate" feature. Update S6. Shellcheck. #81

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
FROM ubuntu:22.04

ARG S6_OVERLAY_VERSION=v2.2.0.3
ARG S6_OVERLAY_ARCH=amd64
ARG S6_OVERLAY_VERSION=v3.1.5.0
ARG S6_OVERLAY_ARCH=x86_64
ARG PLEX_BUILD=linux-x86_64
ARG PLEX_DISTRO=debian
ARG DEBIAN_FRONTEND="noninteractive"
ARG INTEL_NEO_VERSION=20.48.18558
ARG INTEL_IGC_VERSION=1.0.5699
ARG INTEL_GMMLIB_VERSION=20.3.2
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 \
xz-utils \
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 && \
curl -L -s \
"https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" | tar Jxpf - -C / \
&& \
curl -L -s \
"https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz" | tar Jxpf - -C / \
&& \
\
# Add user
useradd -U -d /config -s /bin/false plex && \
Expand All @@ -50,7 +51,18 @@ EXPOSE 32400/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414
VOLUME /config /transcode

ENV CHANGE_CONFIG_DIR_OWNERSHIP="true" \
HOME="/config"
HOME="/config" \
TZ="UTC" \
midzelis marked this conversation as resolved.
Show resolved Hide resolved
\
TERM="xterm" \
LANG="C.UTF-8" \
LC_ALL="C.UTF-8" \
\
S6_KEEP_ENV=1 \
S6_SERVICES_GRACETIME=10000 \
S6_KILL_GRACETIME=5000 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2

ARG TAG=beta
ARG URL=
Expand All @@ -62,3 +74,5 @@ RUN \
/installBinary.sh

HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD /healthcheck.sh || exit 1

ENTRYPOINT ["/init"]
midzelis marked this conversation as resolved.
Show resolved Hide resolved
30 changes: 22 additions & 8 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
FROM arm64v8/ubuntu:22.04

ARG S6_OVERLAY_VERSION=v2.2.0.3
ARG S6_OVERLAY_VERSION=v3.1.5.0
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 \
xz-utils \
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 && \
curl -L -s \
"https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" | tar Jxpf - -C / \
&& \
curl -L -s \
"https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz" | tar Jxpf - -C / \
&& \
\
# Add user
useradd -U -d /config -s /bin/false plex && \
Expand All @@ -47,7 +48,18 @@ EXPOSE 32400/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414
VOLUME /config /transcode

ENV CHANGE_CONFIG_DIR_OWNERSHIP="true" \
HOME="/config"
HOME="/config" \
TZ="UTC" \
\
TERM="xterm" \
LANG="C.UTF-8" \
LC_ALL="C.UTF-8" \
\
S6_KEEP_ENV=1 \
S6_SERVICES_GRACETIME=10000 \
S6_KILL_GRACETIME=5000 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2

ARG TAG=beta
ARG URL=
Expand All @@ -59,3 +71,5 @@ RUN \
/installBinary.sh

HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD /healthcheck.sh || exit 1

ENTRYPOINT ["/init"]
midzelis marked this conversation as resolved.
Show resolved Hide resolved
32 changes: 23 additions & 9 deletions Dockerfile.armv7
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
FROM arm32v7/ubuntu:22.04

ARG S6_OVERLAY_VERSION=v2.2.0.3
ARG S6_OVERLAY_ARCH=armhf
ARG S6_OVERLAY_VERSION=v3.1.5.0
ARG S6_OVERLAY_ARCH=arm
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 \
xz-utils \
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 && \
curl -L -s \
"https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" | tar Jxpf - -C / \
&& \
curl -L -s \
"https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz" | tar Jxpf - -C / \
&& \
\
# Add user
useradd -U -d /config -s /bin/false plex && \
Expand All @@ -47,7 +48,18 @@ EXPOSE 32400/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414
VOLUME /config /transcode

ENV CHANGE_CONFIG_DIR_OWNERSHIP="true" \
HOME="/config"
HOME="/config" \
TZ="UTC" \
\
TERM="xterm" \
LANG="C.UTF-8" \
LC_ALL="C.UTF-8" \
\
S6_KEEP_ENV=1 \
S6_SERVICES_GRACETIME=10000 \
S6_KILL_GRACETIME=5000 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2

ARG TAG=beta
ARG URL=
Expand All @@ -59,3 +71,5 @@ RUN \
/installBinary.sh

HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD /healthcheck.sh || exit 1

ENTRYPOINT ["/init"]
midzelis marked this conversation as resolved.
Show resolved Hide resolved
31 changes: 23 additions & 8 deletions Dockerfile.i386
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
FROM i386/ubuntu:18.04

ARG S6_OVERLAY_VERSION=v2.2.0.3
ARG S6_OVERLAY_ARCH=x86
ARG S6_OVERLAY_VERSION=v3.1.5.0
ARG S6_OVERLAY_ARCH=i686
ARG PLEX_BUILD=linux-x86
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 \
xz-utils \
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 / && \
curl -L -s \
"https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" | tar Jxpf - -C / \
&& \
curl -L -s \
"https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz" | tar Jxpf - -C / \
&& \
\
# Add user
useradd -U -d /config -s /bin/false plex && \
Expand All @@ -46,7 +48,18 @@ EXPOSE 32400/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414
VOLUME /config /transcode

ENV CHANGE_CONFIG_DIR_OWNERSHIP="true" \
HOME="/config"
HOME="/config" \
TZ="UTC" \
\
TERM="xterm" \
LANG="C.UTF-8" \
LC_ALL="C.UTF-8" \
\
S6_KEEP_ENV=1 \
S6_SERVICES_GRACETIME=10000 \
S6_KILL_GRACETIME=5000 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2

ARG TAG=beta
ARG URL=
Expand All @@ -58,3 +71,5 @@ RUN \
/installBinary.sh

HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD /healthcheck.sh || exit 1

ENTRYPOINT ["/init"]
midzelis marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion root/etc/cont-init.d/40-plex-first-run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bash
#!/bin/bash
gbooker marked this conversation as resolved.
Show resolved Hide resolved

# If we are debugging, enable trace
if [ "${DEBUG,,}" = "true" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bash
#!/bin/bash

# Check to make sure the devices exists. If not, exit as there is nothing for us to do
if [ ! -e /dev/dri ] && [ ! -e /dev/dvb ]; then
Expand Down
2 changes: 1 addition & 1 deletion root/etc/cont-init.d/50-plex-update
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bash
#!/bin/bash

# If we are debugging, enable trace
if [ "${DEBUG,,}" = "true" ]; then
Expand Down
18 changes: 0 additions & 18 deletions root/etc/services.d/plex/finish

This file was deleted.

2 changes: 1 addition & 1 deletion root/etc/services.d/plex/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bash
#!/bin/bash

echo "Starting Plex Media Server."
home="$(echo ~plex)"
Expand Down
1 change: 0 additions & 1 deletion root/etc/services.d/plex/timeout-finish

This file was deleted.