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上运行的话怎么做呢 #17

Open
WGwuzhi opened this issue Jul 28, 2021 · 9 comments
Open

想在docker上运行的话怎么做呢 #17

WGwuzhi opened this issue Jul 28, 2021 · 9 comments

Comments

@WGwuzhi
Copy link

WGwuzhi commented Jul 28, 2021

No description provided.

@acooler15
Copy link
Contributor

docker build构建镜像,docker run创建容器运行。
示例:

构建镜像

cd BiliExper
docker build -f Docker/Dockerfile-runner -t maxsecurity/biliiexper:latest Docker/

运行:

填写本项目下config/config.json文件,放到本地任意文件夹下(以路径 '/home/user/Biliexp' 为例)

docker run -d -v /home/user/Biliexp:/BiliExp --name biliexp --restart=always maxsecurity/biliiexper:latest -d -c "16 8,12,18,19 * * 1-5" -c "0 12,18-20 * * 6,7"

-v /home/user/Biliexp:/BiliExp: 映射本地biliexper配置文件所在目录到容器的/BiliExp(必须映射,否则容器无法正常启动)
-d -c "16 8,12,18,19 * * 1-5" -c "0 12,18-20 * * 6,7": -c后跟随的是cron计划任务的时间表达式

若不想构建镜像也可以使用我构建的镜像。。。

docker pull acooler15/biliexper:latest
docker run -d -v /home/user/Biliexp:/BiliExp --name biliexp --restart=always acooler15/biliexper:latest -d -c "16 8,12,18,19 * * 1-5" -c "0 12,18-20 * * 6,7"

@WGwuzhi
Copy link
Author

WGwuzhi commented Jul 30, 2021

写到这一步时-v /home/user/Biliexp:/BiliExp
就跳出下面的提示,就不会弄了

docker run -dit \

-v /home/user/Biliexp:/BiliExp
"docker run" requires at least 1 argument.
See 'docker run --help'.

Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container

@acooler15
Copy link
Contributor

写到这一步时-v /home/user/Biliexp:/BiliExp
就跳出下面的提示,就不会弄了

docker run -dit \

-v /home/user/Biliexp:/BiliExp
"docker run" requires at least 1 argument.
See 'docker run --help'.

Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container

发下具体的命令,如果上面的便是的话,那就是没有写明镜像以及容器的COMMAND参数。
不建议直接使用docker run -it,你看下项目下的Docker/Dockerfile-runner文件和Docker/entrypoint文件,直接使用docker run -it也有可能无法进入容器内。

@acooler15
Copy link
Contributor

docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

运行docker run时,IMAGE时必需的。
当运行docker run -i -t时,IMAGE和COMMAND是必需的。

@WGwuzhi
Copy link
Author

WGwuzhi commented Aug 3, 2021

搞不定

@MaxSecurity
Copy link
Owner

搞不定

你直接运行py脚本比较简单 不需要安装docker什么东西了

@QiYueYiya
Copy link

QiYueYiya commented Oct 9, 2021

安装

将库压缩包下载下来,解压,重命名解压后的文件为BiliExp,然后压缩BiliExp为zip文件,将BiliExp.zip扔进/docker/biliexp/tmp
映射文件夹路径请根据自身情况修改

构建容器

docker run -d \ --name BiliExp \ -v /docker/biliexp/config:/BiliExp \ -v /docker/biliexp/tmp:/tmp \ happy888888/biliexp:runner-latest -d -c "0 19 * * *"

具体命令查看此库的README.md文件说明

@7L787
Copy link

7L787 commented Oct 23, 2021

使用DOcker我怎么知道我部署成功及运行成功了呢

@MaxSecurity
Copy link
Owner

使用DOcker我怎么知道我部署成功及运行成功了呢

进入docker 查看日志文件

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

5 participants