配置容器支持systemctl
# 说明
默认debian容器不支持systemd,需要自己编译
# Dockerfile
文件
FROM debian:12
# RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources # 国内源
RUN apt update
RUN apt install openssh-server -y
RUN apt install python3 -y
RUN apt install init -y
# docker-compose.yml
services:
debian:
build:
dockerfile: Dockerfile
privileged: true
restart: always
command: /usr/sbin/init
上次更新: 2025/09/14, 08:53:50