Files
base/.devcontainer/Dockerfile
孟宁 327e52c994
All checks were successful
CI Pipeline / build (push) Successful in 2s
更新 .devcontainer/Dockerfile
2025-12-14 07:18:06 +00:00

35 lines
868 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM docker.io/library/alpine:3.22
LABEL maintainer="contact@mengning.com.cn"
LABEL version="1.0"
LABEL description="Alpine-based development environment"
# 设置环境变量
ENV WORKSPACE=/workspace \
USERNAME=devstar
# 创建非root用户提高安全性
RUN addgroup -g 1000 $USERNAME && \
adduser -u 1000 -G $USERNAME -s /bin/sh -D $USERNAME
# 安装开发工具合并RUN层减少镜像大小
RUN apk add --no-cache \
build-base \
openssh-server openssh-keygen openssh-client \
openrc \
git \
bash \
curl \
ca-certificates \
&& update-ca-certificates \
&& rm -rf /var/cache/apk/*
# 创建工作目录并设置权限
WORKDIR $WORKSPACE
RUN mkdir -p $WORKSPACE && \
chown -R $USERNAME:$USERNAME $WORKSPACE
# 使用bash作为默认shell
SHELL ["/bin/bash", "-c"]
# 设置默认命令
CMD ["/bin/bash"]