JShaman 制作docker镜像
准备:
1、 文件、目录字母全用小写
2、 Dockerfile必须存在于jshaman目录下
内容为:
#制定node镜像的版本
FROM node:12
ADD . /jshaman2021_oem/
#进入到app目录下面,类似cd
WORKDIR /jshaman2021_oem
#安装依赖
RUN npm install
#对外暴露的端口
EXPOSE 800
#程序启动脚本
CMD ["npm", "start"]
3、 package.json文件内容为:
"name": "jshaman2021",
"version": "1.0.2",
"description": "jshaman 2021",
"main": "jshaman.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node jshaman"
},
"author": "wangliwen",
"license": "ISC",
"dependencies": {
"compressing": "^1.5.1",
"express": "^4.17.1",
"figlet": "^1.5.0",
"javascript-obfuscator": "^2.10.1",
"multiparty": "^4.2.2",
"sync-request": "^6.1.0"
流程:
1、 进入jshaman目录
使用命令,创建:
运行镜像:
部署后授权,需要把容器中的auth.txt文件复制出来:
先查看容器id
再复制文件:
写入授权码之后,再把文件复制回容器:
前面的方法不行,有错误。因为是把文件复制回了容器,而新运行一个容器的时候,启用的是另一个容器。所以不行。
正确的做法是...用正确的方法编辑auth.txt,但我不会。。。
所以,当得到机器码之后,根据机器码,生成授权并写入auth.txt,然后重build一个。
导出镜像
导入镜像
导入
特别声明:以上内容(如有图片或视频亦包括在内)为自媒体平台“网易号”用户上传并发布,本平台仅提供信息存储服务。
Notice: The content above (including the pictures and videos if any) is uploaded and posted by a user of NetEase Hao, which is a social media platform and only provides information storage services.