Skip to content

Instantly share code, notes, and snippets.

@gocs
Last active March 12, 2024 01:17
Show Gist options
  • Save gocs/cb28dbed7f1fa06322e013f20808e44a to your computer and use it in GitHub Desktop.
Save gocs/cb28dbed7f1fa06322e013f20808e44a to your computer and use it in GitHub Desktop.
dockerized lux (annie)

Dockerized lux (annie)

This will eliminate the need to download ffmpeg.
Fixed based on this comment on github: iawia002/lux#1193 (comment)

prereq

create the downloads and mp3ed directories for the services' volumes to be mounted

build and run

docker build -t lux .
docker run --rm lux -i "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

to place the output into a downloadable location using docker compose

docker compose up --build
version: '3'
services:
dl:
build:
context: .
volumes:
- ./downloads:/downloads
# lux -o ./downloads "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
command: -o /downloads "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# # run this ffmpeg service to convert the file into mp3
# to-mp3:
# image: jrottenberg/ffmpeg:4.1-alpine
# depends_on:
# dl:
# condition: service_completed_successfully
# volumes:
# - ./downloads:/downloads
# - ./mp3ed:/mp3ed
# command: -i /downloads/'Rick Astley - Never Gonna Give You Up (Official Music Video).mp4' -vn -acodec libmp3lame -ab 256k /mp3ed/'Rick Astley - Never Gonna Give You Up (Official Music Video).mp3'
FROM alpine:latest
WORKDIR /lux
RUN apk add --no-cache \
curl ca-certificates openssl \
perl curl ffmpeg \
tar gzip jq; \
apkArch="$(apk --print-arch)"; Arch=""; \
case "$apkArch" in \
armel) export Arch='ARM_v6' ;; \
arm64) export Arch='ARM64' ;; \
x86) export Arch='32-bit' ;; \
x86_64) export Arch='x86_64' ;; \
esac; \
v=`curl --request GET --silent \
--url https://api.github.com/repos/iawia002/lux/releases \
--header 'Accept: application/json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
| jq '.[0].tag_name' | tr -d 'v' | tr -d '"'`; \
curl -v --request GET -L \
--url "https://github.com/iawia002/lux/releases/download/v$(echo $v)/lux_$(echo $v)_Linux_$Arch.tar.gz" \
# --header 'application/octet-stream' \
-o lux.tar.gz \
&& tar -xvf lux.tar.gz \
&& rm -rf lux.tar.gz \
&& chmod +x ./lux
ENTRYPOINT ["/lux/lux"]
CMD ["-h"]
dl:
docker compose up --build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment