Add build args to control the subsonic version#5
Open
2-shell wants to merge 1 commit intostuckj:mainfrom
Open
Conversation
This commit adds docker build args for controlling the Subsonic binary
download and refactors the download logic, such that docker images for
multiple specific Subsonic versions can be built more easily.
Also, this adds a safety check on the downloaded binary, by comparing
the SHA-256 of the downloaded archive against specified value.
These args can be used to build multiple images with different subsonic
versions like so:
```sh
docker build -t subsonic-docker:6.1.5 \
--build-arg DL_VERSION=6.1.5 \
--build-arg DL_SHA256=662463f291c747cbea7e7a8b34f3fd65f19ecbbefdff18dedeacc3d23a75e3f7
docker build -t subsonic-docker:6.1.4 \
--build-arg DL_VERSION=6.1.4 \
--build-arg DL_SHA256=2b1998982d8424f115841aa30ab85f9d35a18f9dc38ac62d50f5834a17293a6e
```
Available versions and SHA-256 value can be taken from the official
Subsonic download page: http://www.subsonic.org/pages/download.jsp
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds docker build args for controlling the Subsonic binary download and refactors the download logic, such that docker images for multiple specific Subsonic versions can be built more easily.
Also, this adds a safety check on the downloaded binary, by comparing the SHA-256 of the downloaded archive against the specified value.
These args can be used to build multiple images with different subsonic versions like so:
docker build -t subsonic-docker:6.1.5 \ --build-arg DL_VERSION=6.1.5 \ --build-arg DL_SHA256=662463f291c747cbea7e7a8b34f3fd65f19ecbbefdff18dedeacc3d23a75e3f7 . docker build -t subsonic-docker:6.1.4 \ --build-arg DL_VERSION=6.1.4 \ --build-arg DL_SHA256=2b1998982d8424f115841aa30ab85f9d35a18f9dc38ac62d50f5834a17293a6e .Available versions and SHA-256 values can be taken from the official Subsonic download page.
This does intentionally not implement automatic installation of the latest released binary.
The rationale is, that even for older subsonic versions it must be possible to build updated images (e.g. for receiving distribution package updates, fixing bugs, etc.).
Therefore, this PR provides the foundation for building the image for any Subsonic version from a simple CI script as shown above.
If desired, the file containing all official checksums could be used to build images for all versions with some bash-acrobatics like this:
... or for building just the latest version with something like this:
However, since releases (as you have already said) are infrequent and to avoid instabilities due to changing contents of the checksum file, I'd recommend just setting up a simple CI job with hardcoded values for known and supported versions.
Not knowing anything about you CI infrastructure, an example job for e.g. Gitlab CI could look something like this:
Please let me know what you think about these changes.