-
Notifications
You must be signed in to change notification settings - Fork 554
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
midzelis
wants to merge
15
commits into
plexinc:master
Choose a base branch
from
midzelis:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
156169f
Add multi-arch build/debug helper scripts
midzelis a09c55b
Upgrade to latest Ubuntu LTS (and fix arch base image)
midzelis 63c3c8c
Upgrade to s6-overlay v3
midzelis b0ae80d
Run shellcheck, handle all warnings
midzelis d504440
Add 'strict' mode to bash scripts
midzelis c5f4f70
Move scripts and dynamically link up services.d/cont-init.d
midzelis c5da1c4
Autoupdate functionality
midzelis 83062cd
Use single multi-arch Dockerfile
midzelis 502203f
Allow version-specific builds. Improve build scripts. Readmes.
midzelis 42fdfc9
Log viewer /plex-logs.sh
midzelis 709a6de
Backwards compat. FORCE_UPDATE var
midzelis e2734a5
newlines
midzelis c2fad2c
Do not install on every container start.
midzelis 2cae64a
fix cron schedule
midzelis fcd1c43
bash strict mode prevent hw-transcode script from working properly
midzelis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Dev Helper Scripts | ||
|
||
Unless you are making changes to the Dockerfile themselves, please ignore all the files here. In fact, your environment may be very different and these scripts may not work at all. They are provided only as a reference/starting point so you don't have to start from scratch. Heavy customizations are likely. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# This is just a helper script to quickly test local Dockerfile builds, please run setup-build-env.sh once | ||
|
||
docker buildx build --progress=plain -o type=docker,name=pms-386 --load --platform linux/386 --build-arg AUTOUPDATE=TRUE -f ../Dockerfile .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# This is just a helper script to quickly test local Dockerfile builds, please run setup-build-env.sh once | ||
|
||
# https://github.com/tianon/docker-brew-ubuntu-core/issues/183 explains why need to use --security-opt seccomp:unconfined | ||
docker buildx build --progress=plain --security-opt seccomp:unconfined -o type=docker,name=pms-amd64 --platform linux/amd64 --build-arg AUTOUPDATE=TRUE -f ../Dockerfile .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# This is just a helper script to quickly test local Dockerfile builds, please run setup-build-env.sh once | ||
|
||
# https://github.com/tianon/docker-brew-ubuntu-core/issues/183 explains why need to use --security-opt seccomp:unconfined | ||
docker buildx build --progress=plain --security-opt seccomp:unconfined -o type=docker,name=pms-armv7 --load --platform linux/arm/v7 --build-arg AUTOUPDATE=TRUE -f ../Dockerfile .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# This is just a helper script to quickly test local Dockerfile builds, please run setup-build-env.sh once | ||
|
||
# https://github.com/tianon/docker-brew-ubuntu-core/issues/183 | ||
docker buildx build --progress=plain --security-opt seccomp:unconfined -o type=docker,name=pms-arm64 --load --platform linux/arm64 --build-arg AUTOUPDATE=TRUE -f ../Dockerfile .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# This is just a helper script to quickly test local Dockerfile builds, please run setup-build-env.sh once | ||
|
||
docker run --rm --name pms-386 --platform linux/386 -e DEBUG=true -it pms-386:latest bash | ||
midzelis marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# This is just a helper script to quickly test local Dockerfile builds, please run setup-build-env.sh once | ||
|
||
docker run --rm --name pms-amd64 -e DEBUG=true -it pms-amd64:latest bash | ||
midzelis marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# This is just a helper script to quickly test local Dockerfile builds, please run setup-build-env.sh once | ||
|
||
# Note - S6 overlay does NOT like it when you give it a tty under QEMU - do not run | ||
# the container with "-it" rather, run it in background (so we get log output) then | ||
# exec a bash process to enter the container. | ||
|
||
trap "trap - SIGTERM && docker stop pms-armv7" SIGINT SIGTERM EXIT | ||
docker run --rm --name pms-armv7 --platform linux/arm/v7 -e DEBUG=true pms-armv7:latest & | ||
sleep 5 | ||
docker exec -it pms-armv7 bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# This is just a helper script to quickly test local Dockerfile builds, please run setup-build-env.sh once | ||
|
||
# Note - S6 overlay does NOT like it when you give it a tty under QEMU - do not run | ||
# the container with "-it" rather, run it in background (so we get log output) then | ||
# exec a bash process to enter the container. | ||
|
||
trap "trap - SIGTERM && docker stop pms-arm64" SIGINT SIGTERM EXIT | ||
docker run --rm --name pms-arm64 --platform linux/arm64 -e DEBUG=true pms-arm64:latest & | ||
sleep 5 | ||
docker exec -it pms-arm64 bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker buildx build --progress=plain --push --security-opt seccomp:unconfined --platform linux/amd64,linux/386,linux/arm/v7,linux/arm64 --build-arg AUTOUPDATE=TRUE -f ../Dockerfile --tag INSERT_TAG_HERE:autoupdate .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# This is a one time setup script to setup the build env needed by the build and debug scripts. | ||
# Assumes this is running on Linux (any distro) using (intel/amd). | ||
|
||
# Create a multi-arch buildx builder named PlexBuilder (if it doesn't exist) | ||
if ! docker buildx inspect PlexBuilder 1> /dev/null 2>& 1; then | ||
echo Creating PlexBuilder | ||
# --use will make it automatically use this builder | ||
docker buildx create --name PlexBuilder --platform linux/arm64,linux/arm/v7,linux/386 --use | ||
# this is needed to register the arch-specific images with QEMU to be able to test | ||
# these without native hardware | ||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
fi |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd call this i386 to not change how this arch is spelled in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I can't really change this. The way this multi-arch Dockerfile works is that it pulls from various arch-specific ubuntu images and then names them using the pattern
base-TARGETARCH
where arch comes from the env varTARGETARCH
that is automatically set bydocker build[x]
. The actual selected image is selected on line 24 below.Looks like everyone has opinions, and they are not standardized, on what platforms mean what.
In the case of i386/ubuntu, this is meant to be used when TARGETARCH=386
S6-overlays' has its own opinions, and it maps TARGETARCH=386 to i686. See https://github.com/just-containers/s6-overlay#which-architecture-to-use-depending-on-your-targetarch
More details can be found here: https://github.com/BretFisher/multi-platform-docker-build/blob/main/README.md#the-problem-with-downloading-binaries-in-dockerfiles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, the 32bit Ubuntu image is stuck at v18.04, which is way past EOL. Maybe this build should just be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
18.04 only left support a month ago + a few days but that it still out of support and likely should still be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should stay until the team formally decides to stop supporting it.