#!/bin/sh # 构建Go应用程序 CGO_ENABLED=0 GOOS=linux go build -o hello ./hello.go # 构建Docker镜像 docker build -t hello-app . # 清理生成的二进制文件 rm hello # 运行Docker容器 docker run --rm -p 8080:8080 hello-app