diff --git a/Dockerfile b/Dockerfile index e3d08035..742137d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 @@ -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 \ @@ -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/ diff --git a/bin/start-ui b/bin/start-ui index 284b4c79..a2222998 100755 --- a/bin/start-ui +++ b/bin/start-ui @@ -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