Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM alpine:latest

# 安装编译器和依赖包
RUN apk update \
&& apk add --no-cache git gcc libc-dev zlib-dev zlib-static pcre-dev make curl
&& apk add --no-cache git gcc libc-dev zlib-dev zlib-static pcre-dev lua-dev make curl luarocks

RUN git clone --depth 1 https://github.com/junegunn/vim-plug.git /vim-plug
RUN git clone --depth 1 https://github.com/dzpao/vim-mbs.git /vim-mbs
Expand All @@ -15,6 +15,9 @@ RUN git clone --depth 1 https://github.com/mhinz/vim-startify.git /vim-startify
RUN git clone --depth 1 https://github.com/mudclient/tintin.git --branch beta-develop
WORKDIR /tintin/src/

# 安装 rex_pcre for lua5.1
RUN luarocks-5.1 install lrexlib-pcre

# 这里 hack 了一下 gcc,强制静态编译。
ENV PATH=.:/sbin:/bin:/usr/sbin:/usr/bin
RUN echo '/usr/bin/gcc --static $*' > gcc && chmod +x gcc
Expand All @@ -34,7 +37,7 @@ ENV LANG=zh_CN.UTF8 \
WORKDIR /paotin/

RUN apk update \
&& apk add --no-cache tmux bash ncurses less neovim nano
&& apk add --no-cache tmux bash ncurses less neovim nano lua5.1 pcre

# 设置时区为上海
RUN apk add --no-cache tzdata \
Expand Down Expand Up @@ -65,6 +68,9 @@ COPY --from=0 /mru /paotin/.local/share/nvim/plugged/mru/
COPY --from=0 /BufExplorer /paotin/.local/share/nvim/plugged/BufExplorer/
COPY --from=0 /vim-startify /paotin/.local/share/nvim/plugged/BufExplorer/

RUN mkdir -p /usr/local/lib/lua/5.1
COPY --from=0 /usr/local/lib/lua/5.1/rex_pcre.so /usr/local/lib/lua/5.1/

COPY --from=0 /tintin/src/tt++ /paotin/bin/

RUN mkdir -p /paotin/log/
Expand Down
6 changes: 6 additions & 0 deletions bin/start-ui
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ $TMUXCMD last-pane
$TMUXCMD send-keys -t $SESSION "sleep 0.1; tmux resize-pane -y $HEIGHT; clear; doc HOW-TO-PLAY.md"
$TMUXCMD send-keys -t $SESSION Enter

# 针对单 ID 挂机用户,可以通过提供 auto 参数在启动 UI 后继续完成 tt 的拉起与角色的登录动作
if [ "x$MODE" == "xauto" ]; then
$TMUXCMD send-keys -t $SESSION "start $HOSTNAME"
$TMUXCMD send-keys -t $SESSION Enter
fi

echo UI 已创建。

exec $TMUXCMD attach-session -t $SESSION