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

能否出一个docker版本 #1193

Open
Jimumeor opened this issue Feb 3, 2023 · 4 comments
Open

能否出一个docker版本 #1193

Jimumeor opened this issue Feb 3, 2023 · 4 comments

Comments

@Jimumeor
Copy link

Jimumeor commented Feb 3, 2023

No description provided.

@sakurayang
Copy link

Dockerfile:

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='64-bit';; \
        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 --request GET -L \
             --url "https://github.com/iawia002/lux/releases/download/v$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"]

@Jimumeor
Copy link
Author

Dockerfile:

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='64-bit';; \
        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 --request GET -L \
             --url "https://github.com/iawia002/lux/releases/download/v$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"]

您好,我已打包镜像,但是不知道端口、路径和环境变量,输入“docker run -d -p 2580:80 lux”命令后有容器生成,但是立马自动关闭了,麻烦您指导一下,谢谢!!
容器有日志生成:
2023-02-13 21:53:05 NAME:
2023-02-13 21:53:05 lux - A fast and simple video downloader.
2023-02-13 21:53:05
2023-02-13 21:53:05 USAGE:
2023-02-13 21:53:05 lux [global options] command [command options] [arguments...]
2023-02-13 21:53:05
2023-02-13 21:53:05 VERSION:
2023-02-13 21:53:05 v0.16.0
2023-02-13 21:53:05
2023-02-13 21:53:05 COMMANDS:
2023-02-13 21:53:05 help, h Shows a list of commands or help for one command
2023-02-13 21:53:05
2023-02-13 21:53:05 GLOBAL OPTIONS:
2023-02-13 21:53:05 --aria2 Use Aria2 RPC to download (default: false)
2023-02-13 21:53:05 --aria2-addr value Aria2 Address (default: "localhost:6800")
2023-02-13 21:53:05 --aria2-method value Aria2 Method (default: "http")
2023-02-13 21:53:05 --aria2-token value Aria2 RPC Token
2023-02-13 21:53:05 --caption, -C Download captions (default: false)
2023-02-13 21:53:05 --chunk-size value, --cs value HTTP chunk size for downloading (in MB) (default: 1)
2023-02-13 21:53:05 --cookie value, -c value Cookie
2023-02-13 21:53:05 --debug, -d Debug mode (default: false)
2023-02-13 21:53:05 --end value Define the ending item of a playlist or a file input (default: 0)
2023-02-13 21:53:05 --episode-title-only, --eto File name of each bilibili episode doesn't include the playlist title (default: false)
2023-02-13 21:53:05 --file value, -F value URLs file path
2023-02-13 21:53:05 --file-name-length value The maximum length of a file name, 0 means unlimited (default: 255)
2023-02-13 21:53:05 --info, -i Information only (default: false)
2023-02-13 21:53:05 --items value Define wanted items from a file or playlist. Separated by commas like: 1,5,6,8-10
2023-02-13 21:53:05 --json, -j Print extracted JSON data (default: false)
2023-02-13 21:53:05 --multi-thread, -m Multiple threads to download single video (default: false)
2023-02-13 21:53:05 --output-name value, -O value Specify the output file name
2023-02-13 21:53:05 --output-path value, -o value Specify the output path
2023-02-13 21:53:05 --playlist, -p Download playlist (default: false)
2023-02-13 21:53:05 --refer value, -r value Use specified Referrer
2023-02-13 21:53:05 --retry value How many times to retry when the download failed (default: 10)
2023-02-13 21:53:05 --silent, -s Minimum outputs (default: false)
2023-02-13 21:53:05 --start value Define the starting item of a playlist or a file input (default: 1)
2023-02-13 21:53:05 --stream-format value, -f value Select specific stream to download
2023-02-13 21:53:05 --thread value, -n value The number of download thread (only works for multiple-parts video) (default: 10)
2023-02-13 21:53:05 --user-agent value, -u value Use specified User-Agent
2023-02-13 21:53:05 --youku-ccode value, --ccode value Youku ccode (default: "0502")
2023-02-13 21:53:05 --youku-ckey value, --ckey value Youku ckey (default: "7B19C0AB12633B22E7FE81271162026020570708D6CC189E4924503C49D243A0DE6CD84A766832C2C99898FC5ED31F3709BB3CDD82C96492E721BDD381735026")
2023-02-13 21:53:05 --youku-password value, --password value Youku password
2023-02-13 21:53:05 --help, -h show help (default: false)
2023-02-13 21:53:05 --version, -v print the version (default: false)

@sakurayang
Copy link

sakurayang commented Feb 15, 2023

lux 并不能以持久性的服务器形式运行,也没有暴露端口,用法与lux本身没有什么不同

如果想要以 http request 方式调用 lux,那就不是一个简单的 docker 镜像能解决的了

如果有相关的想法的话可以参考 #364

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

 Site:      YouTube youtube.com
 Title:     Rick Astley - Never Gonna Give You Up (Video)
 Type:      video
 Streams:   # All available quality
     [248]  -------------------
     Quality:         1080p video/webm; codecs="vp9"
     Size:            49.29 MiB (51687554 Bytes)
     # download with: lux -f 248 ...

     [137]  -------------------
     Quality:         1080p video/mp4; codecs="avc1.640028"
     Size:            43.45 MiB (45564306 Bytes)
     # download with: lux -f 137 ...

     [398]  -------------------
     Quality:         720p video/mp4; codecs="av01.0.05M.08"
     Size:            37.12 MiB (38926432 Bytes)
     # download with: lux -f 398 ...

     [136]  -------------------
     Quality:         720p video/mp4; codecs="avc1.4d401f"
     Size:            31.34 MiB (32867324 Bytes)
     # download with: lux -f 136 ...

     [247]  -------------------
     Quality:         720p video/webm; codecs="vp9"
     Size:            31.03 MiB (32536181 Bytes)
     # download with: lux -f 247 ...

@Jimumeor
Copy link
Author

lux 并不能以持久性的服务器形式运行,也没有暴露端口,用法与lux本身没有什么不同

如果想要以 http request 方式调用 lux,那就不是一个简单的 docker 镜像能解决的了

如果有相关的想法的话可以参考 #364

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



 Site:      YouTube youtube.com

 Title:     Rick Astley - Never Gonna Give You Up (Video)

 Type:      video

 Streams:   # All available quality

     [248]  -------------------

     Quality:         1080p video/webm; codecs="vp9"

     Size:            49.29 MiB (51687554 Bytes)

     # download with: lux -f 248 ...



     [137]  -------------------

     Quality:         1080p video/mp4; codecs="avc1.640028"

     Size:            43.45 MiB (45564306 Bytes)

     # download with: lux -f 137 ...



     [398]  -------------------

     Quality:         720p video/mp4; codecs="av01.0.05M.08"

     Size:            37.12 MiB (38926432 Bytes)

     # download with: lux -f 398 ...



     [136]  -------------------

     Quality:         720p video/mp4; codecs="avc1.4d401f"

     Size:            31.34 MiB (32867324 Bytes)

     # download with: lux -f 136 ...



     [247]  -------------------

     Quality:         720p video/webm; codecs="vp9"

     Size:            31.03 MiB (32536181 Bytes)

     # download with: lux -f 247 ...

好的,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants