Dinushi Dhananjani
Dinushi Dhananjani

Reputation: 1

ERROR [builder 6/6] RUN CGO_ENABLED=0 GOOS=linux go build -o main

Docker build command docker build -t comin-leave-management-service:latest .

Docker File

FROM golang:1.23.4-alpine AS builder

WORKDIR /app

COPY go.mod go.sum ./

RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -o main .

FROM alpine:latest

WORKDIR /app

COPY --from=builder /app/main .

EXPOSE 8080

CMD ["./main"]

The thing is in this go backend service repo file structer is enter image description here

So in this case, the main.go file should be in the root or changing the dockerfile with the path will be the solution

Here I am doing Devops part in this project I am not the developer The repo i cloned had the file structure that i shared with

Looking for the help

thank you

Upvotes: -1

Views: 43

Answers (0)

Related Questions