Created docker-flexget
This commit is contained in:
commit
9ceb56b06b
18
.editorconfig
Normal file
18
.editorconfig
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# EditorConfig is awesome: https://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Unix-style newlines with a newline ending every file
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
# 4 space indentation
|
||||||
|
[*.sh]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
# Tab indentation (no size specified)
|
||||||
|
[Makefile]
|
||||||
|
indent_style = tab
|
||||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
config/
|
||||||
|
download/
|
||||||
|
*.img
|
||||||
29
Dockerfile
Normal file
29
Dockerfile
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
FROM python:3-alpine
|
||||||
|
LABEL maintainer="Winston Astrachan"
|
||||||
|
LABEL description="FlexGet on Alpine Linux"
|
||||||
|
|
||||||
|
ARG FLEXGET_VERSION="2.20.11"
|
||||||
|
|
||||||
|
RUN addgroup -g 101 -S flexget && \
|
||||||
|
adduser -u 100 -S -G flexget flexget
|
||||||
|
|
||||||
|
RUN mkdir /config && \
|
||||||
|
mkdir /download
|
||||||
|
|
||||||
|
VOLUME /config
|
||||||
|
VOLUME /download
|
||||||
|
|
||||||
|
COPY overlay/ /
|
||||||
|
ADD https://github.com/Flexget/Flexget/tarball/${FLEXGET_VERSION} flexget.tar.gz
|
||||||
|
RUN \
|
||||||
|
# Extract and install FlexGet
|
||||||
|
mkdir flexget && \
|
||||||
|
tar --strip-components=1 -xzvf flexget.tar.gz -C flexget && \
|
||||||
|
cd flexget && \
|
||||||
|
python3 setup.py install && \
|
||||||
|
\
|
||||||
|
# Clean up build files, deps
|
||||||
|
rm -rf /flexget /flexget.tar.gz
|
||||||
|
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
|
CMD ["su", "-p", "-s", "/bin/sh", "flexget", "-c", "/usr/local/bin/flexget -c /config/config.yml --loglevel verbose execute"]
|
||||||
20
LICENSE
Normal file
20
LICENSE
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
Copyright (c) 2019 Winston Astrachan
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
46
Makefile
Normal file
46
Makefile
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
# Docker FlexGet Image
|
||||||
|
#
|
||||||
|
# Winston Astrachan 2019
|
||||||
|
#
|
||||||
|
help:
|
||||||
|
@echo ""
|
||||||
|
@echo "Usage: make COMMAND"
|
||||||
|
@echo ""
|
||||||
|
@echo "Docker FlexGet image makefile"
|
||||||
|
@echo ""
|
||||||
|
@echo "Commands:"
|
||||||
|
@echo " build Build and tag image"
|
||||||
|
@echo " run Start container in the background with locally mounted volume"
|
||||||
|
@echo " stop Stop and remove container running in the background"
|
||||||
|
@echo " clean Mark image for rebuild"
|
||||||
|
@echo " delete Delete image and mark for rebuild"
|
||||||
|
@echo ""
|
||||||
|
|
||||||
|
build: .flexget.img
|
||||||
|
|
||||||
|
.flexget.img:
|
||||||
|
docker build -t wastrachan/flexget:latest .
|
||||||
|
@touch $@
|
||||||
|
|
||||||
|
.PHONY: run
|
||||||
|
run: build
|
||||||
|
docker run -v "$(CURDIR)/config:/config" \
|
||||||
|
--name flexget \
|
||||||
|
-e PUID=1111 \
|
||||||
|
-e PGID=1112 \
|
||||||
|
--restart unless-stopped \
|
||||||
|
-d \
|
||||||
|
wastrachan/flexget:latest
|
||||||
|
|
||||||
|
.PHONY: stop
|
||||||
|
stop:
|
||||||
|
docker stop flexget
|
||||||
|
docker rm flexget
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
rm -f .flexget.img
|
||||||
|
|
||||||
|
.PHONY: delete
|
||||||
|
delete: clean
|
||||||
|
docker rmi -f wastrachan/flexget
|
||||||
85
README.md
Normal file
85
README.md
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
FlexGet Docker Image
|
||||||
|
====================
|
||||||
|
|
||||||
|
FlexGet in a Docker container, with configuration in a volume, and a configurable UID/GID for said files.
|
||||||
|
|
||||||
|
[](https://github.com/wastrachan/docker-flexget/releases)
|
||||||
|
[](https://microbadger.com/images/wastrachan/docker-flexget)
|
||||||
|
[](https://hub.docker.com/r/wastrachan/docker-flexget)
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
#### Docker Hub
|
||||||
|
Pull the latest image from Docker Hub:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker pull wastrachan/flexget
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Manually
|
||||||
|
Clone this repository, and run `make build` to build an image:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git clone https://github.com/wastrachan/docker-flexget
|
||||||
|
cd docker-flexget
|
||||||
|
make build
|
||||||
|
```
|
||||||
|
|
||||||
|
If you need to rebuild the image, run `make clean build`.
|
||||||
|
|
||||||
|
|
||||||
|
## Run
|
||||||
|
|
||||||
|
#### Docker
|
||||||
|
Run this image with the `make run` shortcut, or manually with `docker run`.
|
||||||
|
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker run -v "$(pwd)/config:/config" \
|
||||||
|
--name flexget \
|
||||||
|
-e PUID=1111 \
|
||||||
|
-e PGID=1112 \
|
||||||
|
--restart unless-stopped \
|
||||||
|
wastrachan/flexget:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### Docker Compose
|
||||||
|
If you wish to run this image with docker-compose, an example `docker-compose.yml` might read as follows:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: "2"
|
||||||
|
|
||||||
|
services:
|
||||||
|
bind:
|
||||||
|
image: wastrachan/flexget
|
||||||
|
container_name: flexget
|
||||||
|
environment:
|
||||||
|
- PUID=1111
|
||||||
|
- PGID=1112
|
||||||
|
volumes:
|
||||||
|
- </path/to/config>:/config
|
||||||
|
restart: unless-stopped
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
Configuration files are stored in the `/config` volume. You may wish to mount this volume as a local directory, as shown in the examples above.
|
||||||
|
|
||||||
|
The main config file for FlexGet is `config.yml`, and will be created automatically if the container is started without a config file present. Please review the [FlexGet docs](https://flexget.com/Configuration) for more information.
|
||||||
|
|
||||||
|
|
||||||
|
#### User / Group Identifiers
|
||||||
|
If you'd like to override the UID and GID of the `{{ program }}` process, you can do so with the environment variables `PUID` and `PGID`. This is helpful if other containers must access your configuration volume.
|
||||||
|
|
||||||
|
#### Volumes
|
||||||
|
Volume | Description
|
||||||
|
----------------|-------------
|
||||||
|
`/config` | Configuration directory
|
||||||
|
|
||||||
|
|
||||||
|
## License
|
||||||
|
The content of this project itself is licensed under the [MIT License](LICENSE).
|
||||||
|
|
||||||
|
View [license information](https://github.com/Flexget/Flexget/blob/develop/LICENSE) for the software contained in this image.
|
||||||
8
overlay/defaults/config.yml
Normal file
8
overlay/defaults/config.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
tasks:
|
||||||
|
test task:
|
||||||
|
rss: http://mysite.com/myfeed.rss
|
||||||
|
series:
|
||||||
|
- My Favorite Show
|
||||||
|
- Another Good Show:
|
||||||
|
quality: 720p
|
||||||
|
download: /download
|
||||||
28
overlay/docker-entrypoint.sh
Executable file
28
overlay/docker-entrypoint.sh
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
PUID="${PUID:-100}"
|
||||||
|
PGID="${PGID:-101}"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "----------------------------------------"
|
||||||
|
echo " Starting FlexGet, using the following: "
|
||||||
|
echo " "
|
||||||
|
echo " UID: $PUID "
|
||||||
|
echo " GID: $PGID "
|
||||||
|
echo "----------------------------------------"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Copy default config files
|
||||||
|
if [ ! -f "/config/config.yml" ]; then
|
||||||
|
cp /defaults/config.yml /config/config.yml
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set UID/GID of user
|
||||||
|
sed -i "s/^flexget\:x\:100\:101/flexget\:x\:$PUID\:$PGID/" /etc/passwd
|
||||||
|
sed -i "s/^flexget\:x\:101/flexget\:x\:$PGID/" /etc/group
|
||||||
|
|
||||||
|
# Set permissions
|
||||||
|
chown -R $PUID:$PGID /config
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
Loading…
Reference in New Issue
Block a user