add docker building in pipeline
This commit is contained in:
4
build/docker/.dockerignore
Normal file
4
build/docker/.dockerignore
Normal file
@@ -0,0 +1,4 @@
|
||||
k8s-admin.conf
|
||||
docs
|
||||
*/build
|
||||
examples
|
||||
28
build/docker/Dockerfile
Normal file
28
build/docker/Dockerfile
Normal 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", "."]
|
||||
Reference in New Issue
Block a user