entrypoint.sh

#!/bin/bash
set -euo pipefail

# 拉取文件
aws s3 cp s3://12346/server.zip /app/server.zip
aws s3 cp s3://123465/config.json /app/config.json

# 解压
unzip -o /app/server.zip -d /app

# 赋权
chmod +x /app/server1

# 以前台方式启动 server1
exec /app/server1

Dockerfile

FROM amazonlinux
RUN yum install -y unzip awscli
WORKDIR /app
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 8080
ENTRYPOINT ["/entrypoint.sh"]

Logo

码道开发者社区,聚焦华为云码道 CodeArts 代码智能体,沉淀 Agent、Skill、鸿蒙开发实战内容,供开发者查阅资料、交流技术、分享工程实践

更多推荐