Add dockerfile for running in docker

This commit is contained in:
2025-11-16 19:26:27 +07:00
parent 112f82ed74
commit ea8886f5fc
2 changed files with 64 additions and 0 deletions

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
FROM golang:1.21-alpine AS builder
WORKDIR /app
RUN apk add --no-cache git
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -o proxmox-cloud-image
FROM ubuntu:22.04
RUN apt-get update && \
apt-get install -y \
qemu-utils \
libguestfs-tools \
openssh-client \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/proxmox-cloud-image /usr/local/bin/
WORKDIR /workspace
ENTRYPOINT ["proxmox-cloud-image"]