DevOps-Go/Dockerfile

20 lines
511 B
Docker
Raw 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.

# 使用Alpine Linux作为基础镜像
FROM alpine:latest
# 设置作者标签
LABEL authors="18257"
# 安装必要的运行时依赖(如果有的话)
# 例如如果你的应用程序需要CGO支持你可能需要安装一些库
# RUN apk add --no-cache libc6-compat
# 将Go应用程序二进制文件复制到镜像中
# 假设你的Go应用程序二进制文件名为hello
COPY hello /app/hello
# 设置工作目录
WORKDIR /app
# 设置容器启动时运行的命令
ENTRYPOINT ["/app/hello"]