Skip to content

Commit 247c18c

Browse files
committed
fix: 修复Dockerfile hadolint警告
- 添加WORKDIR设置(DL3045) - 添加dnf clean all清理缓存(DL3040) - 使用./*.py避免glob被解释为选项(SC2035) - 忽略版本固定警告(DL3016,DL3041)以支持自动更新
1 parent 75a5e19 commit 247c18c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

agent-sdk-server/Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
FROM public.ecr.aws/lambda/python:3.12-arm64
22

3+
# Set working directory (Lambda default)
4+
WORKDIR ${LAMBDA_TASK_ROOT}
5+
36
# Install uv and create uvx symlink
47
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
58
RUN ln -s /usr/local/bin/uv /usr/local/bin/uvx
69

710
# Install Claude Code CLI (npm package, requires nodejs)
8-
RUN dnf install -y nodejs npm && npm install -g @anthropic-ai/claude-code
11+
# hadolint ignore=DL3016,DL3041
12+
RUN dnf install -y nodejs npm && \
13+
dnf clean all && \
14+
npm install -g @anthropic-ai/claude-code
915

1016
# Install Python dependencies
1117
RUN uv pip install --system boto3 claude-agent-sdk
1218

1319
# Copy Lambda code and ensure readable
14-
COPY *.py ./
15-
RUN chmod 644 *.py
20+
COPY ./*.py ./
21+
RUN chmod 644 ./*.py
1622

1723
# Copy config files (MCP servers, SubAgents) to /opt (read-only at runtime)
1824
# setup_lambda_environment() will copy to /tmp/.claude-code at runtime

0 commit comments

Comments
 (0)