add docker building in pipeline

This commit is contained in:
2024-05-15 20:28:53 +03:00
parent 26b326dd4f
commit 7f62c601df
13 changed files with 532 additions and 2 deletions

28
build/docker/Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
## Install dependencies
FROM python:3.12 as deps
WORKDIR /application
COPY ./requirements.txt ./
RUN apt-get update -y && \
apt-get install sshpass -y && \
pip3 install -r requirements.txt
## Build executable
FROM golang:alpine as builder
WORKDIR /application
COPY go.mod go.sum ./
RUN go mod download
WORKDIR /application
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -v -o kube-forge ./cmd/main/main.go
FROM deps
WORKDIR /application
COPY . .
COPY --from=builder /application/kube-forge /application/kube-forge
ENTRYPOINT ["./kube-forge", "-c", "config.yaml", "-d", "."]