-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
90 lines (71 loc) · 2.91 KB
/
Dockerfile
File metadata and controls
90 lines (71 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
FROM expm02/ubuntu-gcc-cmake-docker:latest
# -----------------------------------------------------
# 安装 openkore 环境
# https://openkore.com/wiki/How_to_run_OpenKore
# -----------------------------------------------------
RUN apt-get update -y
# 1. C/C++ compiler
# 检查命令: g++ -v
# 已在基础镜像,无需安装
# 2. Perl
# 检查命令: perl -v | grep perl
RUN apt-get install -y perl
# 3. Perl module: Time::HiRes
# 检查命令: perl -e 'use Time::HiRes;'
RUN apt-get install -y libtime-hires-perl
# 4. Perl module: Compress::Zlib
# 检查命令: perl -e 'use Compress::Zlib;'
RUN apt-get install -y libcompress-zlib-perl
# 5. GNU readline
# 检查命令: gcc -c /root/readlinetest.c
ADD ./res/readlinetest.c /root/readlinetest.c
RUN apt-get install -y libreadline-dev
# 6. Python2
# 检查命令: echo 'print "Python is installed"' | python
# 基础镜像已有 Python3,非必要无需换 Python2
# RUN apt-get install -y python2
# RUN rm -f /usr/bin/python && \
# ln -s /usr/bin/python2 /usr/bin/python
# RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
# RUN python get-pip.py
# 7. Curl development libraries
# 检查命令: curl-config --version
# 搜索当前系统下的最新版本: apt-cache search libcurl
RUN apt-get install -y libcurl4-openssl-dev
# -----------------------------------------------------
# 下载 openkore
# -----------------------------------------------------
ARG APP_DIR="/app"
ARG OPENKORE_NAME="openkore"
ENV OPENKORE_DIR="${APP_DIR}/${OPENKORE_NAME}"
# 方法一: git 下载仓库(海外网络不好可能会失败)
RUN git config --global http.postBuffer 524288000 && \
git config --global http.lowSpeedLimit 0 && \
git config --global http.lowSpeedTime 999999
RUN mkdir -p ${APP_DIR}
RUN cd ${APP_DIR} && \
git clone --depth 1 --branch master https://github.com/Casual-Ragnarok/openkore
# -----------------------------------------------------
# 方法二: http 下载 zip 仓库
# RUN cd ${APP_DIR} && \
# wget https://codeload.github.com/Casual-Ragnarok/openkore/zip/refs/heads/master -O ${OPENKORE_NAME}.zip && \
# unzip ${OPENKORE_NAME}.zip && \
# rm -f ${OPENKORE_NAME}.zip && \
# mv ${OPENKORE_NAME}-master ${OPENKORE_NAME}
# -----------------------------------------------------
# 方法三:直接从本地克隆
# COPY ./openkore ${OPENKORE_DIR}
# -----------------------------------------------------
# -----------------------------------------------------
# 编译 openkore (首次执行会触发编译、Dockerfile 内执行会自动终止交互)
# -----------------------------------------------------
RUN cd ${OPENKORE_DIR} && perl ./openkore.pl
ENV TZ="Asia/Shanghai"
ENV LANG="zh_CN.UTF-8"
ENV LANGUAGE="zh_CN.UTF-8"
ENV LC_ALL="zh_CN.UTF-8"
WORKDIR ${OPENKORE_DIR}
ADD ./res/bin /bin
RUN chmod 100 /bin/.docker-entrypoint.sh && \
chmod 100 /bin/.wrapper.sh
ENTRYPOINT [ "/bin/.wrapper.sh" ]