L37※Dockerfile

docker build -t docker_name .

1> ubuntu

FROM ubuntu:20.04

# 更换镜像源
RUN sed -i "s@http://.*archive.ubuntu.com@http://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list
RUN sed -i "s@http://.*security.ubuntu.com@http://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list

# 安装包
RUN apt-get update && apt-get install -y init && apt-get clean all
RUN apt-get update && apt-get install -y net-tools openssh-server language-pack-zh-hans git vim lsof

# 添加中文支持
RUN locale-gen zh_CN.UTF-8
RUN echo 'LANG="zh_CN.UTF-8"' >> /etc/default/locale
RUN echo 'LANGUAGE="zh_CN:zh:en_US:en"' >> /etc/default/locale

# 设置默认 shell
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN source /etc/default/locale

# 设置环境变量
ENV LC_ALL=zh_CN.UTF-8

# ssh远程连接
RUN mkdir /var/run/sshd
RUN echo 'root:password' | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

# 创建工作目录
RUN mkdir /data
WORKDIR /data

# 暴露端口
EXPOSE 22 80

# 启动 SSH 服务
CMD ["/usr/sbin/sshd", "-D"]
docker run -itd --name=ubuntu --hostname=docker-ubuntu --privileged=true --restart=always \
-p 12080:80 -p 12020:22 \
-v /data/docker/ubuntu:/data ubuntu:20.04 /sbin/init

2> kms

FROM alpine:latest as builder
WORKDIR /root
RUN apk add --no-cache git make build-base && \
    git clone --branch master --single-branch https://github.com/Wind4/vlmcsd.git && \
    cd vlmcsd/ && \
    make

FROM alpine:latest
WORKDIR /root/
COPY --from=builder /root/vlmcsd/bin/vlmcsd /usr/bin/vlmcsd
EXPOSE 1688
CMD [ "/usr/bin/vlmcsd", "-D", "-d" ]

© 版权声明
THE END
喜欢就支持一下吧
点赞1 分享