# ... 前面的内容保持不变 ... # 将 release 目录下的文件转移到 WORKDIR,并添加调试信息 RUN if [ -d "/app/linux-amd64/release" ]; then \ echo "Moving files from /app/linux-amd64/release to /app"; \ mv /app/linux-amd64/release/* /app/ ; \ echo "Files moved successfully"; \ else \ echo "/app/linux-amd64/release directory does not exist"; \ fi # 检查 apimain 文件是否存在,并添加调试信息 RUN if [ -f "/app/apimain" ]; then \ echo "apimain file exists"; \ chmod +x /app/apimain; \ echo "apimain file permission set to executable"; \ else \ echo "apimain file does not exist"; \ fi # 运行可执行文件(假设可执行文件名为 apimain) CMD ["./apimain"]