Compare commits
1 Commits
cherry-pic
...
alpine-web
| Author | SHA1 | Date | |
|---|---|---|---|
| 0b79111ec0 |
@@ -1,42 +1,49 @@
|
||||
FROM docker.io/library/ubuntu:24.04 AS build-env
|
||||
FROM docker.io/library/alpine:3.22 AS build-env
|
||||
|
||||
RUN echo "https://mirrors.ustc.edu.cn/alpine/v3.22/main" > /etc/apk/repositories && \
|
||||
echo "https://mirrors.ustc.edu.cn/alpine/v3.22/community" >> /etc/apk/repositories
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
git \
|
||||
build-essential \
|
||||
RUN apk add --no-cache \
|
||||
build-base \
|
||||
cmake \
|
||||
libjson-c-dev \
|
||||
libwebsockets-dev
|
||||
git \
|
||||
linux-headers \
|
||||
libwebsockets-dev \
|
||||
json-c-dev \
|
||||
openssl-dev \
|
||||
zlib-dev \
|
||||
libuv-dev \
|
||||
vim
|
||||
|
||||
RUN git clone https://devstar.cn/devstar/webTerminal.git /home/webTerminal
|
||||
# 设置工作目录并构建
|
||||
|
||||
WORKDIR /home/webTerminal/build
|
||||
RUN cmake ..
|
||||
RUN make && make install
|
||||
|
||||
FROM docker.io/library/alpine:3.22
|
||||
|
||||
FROM ubuntu:24.04
|
||||
|
||||
# 从构建阶段复制编译好的程序
|
||||
COPY --from=build-env /home/webTerminal/build/ttyd /home/webTerminal/build/ttyd
|
||||
|
||||
# 只安装运行时需要的库
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
curl && \
|
||||
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \
|
||||
apt-get install -y tini \
|
||||
libjson-c-dev \
|
||||
libwebsockets-dev && \
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ \
|
||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
||||
tee /etc/apt/sources.list.d/docker.list > /dev/null && \
|
||||
apt-get update && apt-get install -y docker-ce-cli && \
|
||||
apt remove --purge curl -y && apt autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
RUN echo "https://mirrors.ustc.edu.cn/alpine/v3.22/main" > /etc/apk/repositories && \
|
||||
echo "https://mirrors.ustc.edu.cn/alpine/v3.22/community" >> /etc/apk/repositories
|
||||
|
||||
ENTRYPOINT ["/usr/bin/tini", "--"]
|
||||
RUN apk add --no-cache \
|
||||
bash \
|
||||
git \
|
||||
openssh \
|
||||
openssh-server \
|
||||
openssh-client \
|
||||
openssh-keygen \
|
||||
docker-cli \
|
||||
tini \
|
||||
json-c \
|
||||
libwebsockets \
|
||||
libwebsockets-evlib_uv \
|
||||
libuv \
|
||||
curl
|
||||
|
||||
ENTRYPOINT ["/sbin/tini", "--"]
|
||||
CMD ["/home/webTerminal/build/ttyd", "-W", "bash"]
|
||||
|
||||
# To acquire devstar.cn/devstar/webterminal:latest:
|
||||
|
||||
Reference in New Issue
Block a user