2024-07-09 11:29:50 +08:00
# 参考https://github.com/linuxserver/docker-code-server/blob/master/Dockerfile
# https://github.com/linuxserver/docker-baseimage-ubuntu/blob/jammy/Dockerfile
2024-07-02 13:00:00 +08:00
FROM build-dmpython
ENV DEBIAN_FRONTEND = "noninteractive"
WORKDIR /home/dmdba
USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
2024-07-09 11:29:50 +08:00
git jq libatomic1 net-tools netcat python3-pip curl sudo catatonit libssl-dev \
2024-07-02 13:00:00 +08:00
cron \
curl \
gnupg \
2024-06-19 13:13:34 +08:00
jq \
netcat \
2024-07-02 13:00:00 +08:00
tzdata \
xz-utils \
&& CODE_RELEASE = $( curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest | awk '/tag_name/{print $4;exit}' FS = '[""]' | sed 's|^v||' ) \
&& mkdir -p /app/code-server \
&& curl -o /tmp/code-server.tar.gz -L " https://github.com/coder/code-server/releases/download/v ${ CODE_RELEASE } /code-server- ${ CODE_RELEASE } -linux-amd64.tar.gz " \
&& tar xf /tmp/code-server.tar.gz -C /app/code-server --strip-components= 1 \
&& apt-get clean \
&& rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* \
&& pip3 install /home/dmdba/build_artifacts/dmPython-2.5.5-cp310-cp310-linux_x86_64.whl \
2024-07-09 11:29:50 +08:00
&& rm /home/dmdba/build_artifacts/dmPython-2.5.5-cp310-cp310-linux_x86_64.whl \
&& cp /home/dmdba/build_artifacts/libdmdpi.so /usr/lib/
2024-07-02 13:00:00 +08:00
2024-07-09 11:29:50 +08:00
# 设置环境变量
2024-07-02 13:00:00 +08:00
ENV HOME = "/root" \
LANGUAGE = "en_US.UTF-8" \
LANG = "en_US.UTF-8" \
TERM = "xterm" \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME = "0" \
S6_VERBOSITY = 1 \
S6_STAGE2_HOOK = /docker-mods \
VIRTUAL_ENV = /lsiopy \
PATH = " /lsiopy/bin: $PATH " \
HOME = "/config"
2024-07-09 11:29:50 +08:00
# 设置环境变量 s6 overlay
2024-07-02 13:00:00 +08:00
ARG S6_OVERLAY_VERSION = "3.1.6.2"
ARG S6_OVERLAY_ARCH = "x86_64"
2024-07-09 11:29:50 +08:00
# 解压
2024-07-02 13:00:00 +08:00
ADD https://github.com/just-containers/s6-overlay/releases/download/v${ S6_OVERLAY_VERSION } /s6-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${ S6_OVERLAY_VERSION } /s6-overlay-${ S6_OVERLAY_ARCH } .tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-${ S6_OVERLAY_ARCH } .tar.xz
2024-07-09 11:29:50 +08:00
ADD https://nodejs.org/dist/v20.15.0/node-v20.15.0-linux-x64.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/node-v20.15.0-linux-x64.tar.xz --strip-components 1 --keep-old-files
2024-07-02 13:00:00 +08:00
ADD https://github.com/just-containers/s6-overlay/releases/download/v${ S6_OVERLAY_VERSION } /s6-overlay-symlinks-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${ S6_OVERLAY_VERSION } /s6-overlay-symlinks-arch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz && \
useradd -u 911 -U -d /config -s /bin/false abc && \
usermod -G users abc && \
mkdir -p \
/app \
/config \
/defaults \
2024-07-09 11:29:50 +08:00
/lsiopy && \
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*
2024-07-02 13:00:00 +08:00
ARG MODS_VERSION = "v3"
ARG PKG_INST_VERSION = "v1"
ARG LSIOWN_VERSION = "v1"
ADD --chmod= 744 " https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods. ${ MODS_VERSION } " "/docker-mods"
ADD --chmod= 744 " https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install. ${ PKG_INST_VERSION } " "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run"
ADD --chmod= 744 " https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown. ${ LSIOWN_VERSION } " "/usr/bin/lsiown"
2024-06-19 13:13:34 +08:00
2024-07-09 11:29:50 +08:00
# 添加本地目录
2024-06-19 13:13:34 +08:00
COPY /root /
2024-07-09 11:29:50 +08:00
# 端口
2024-07-02 13:00:00 +08:00
EXPOSE 5000 3000 8443
ENTRYPOINT [ "/init" ]