Thanks for posting your question in the Microsoft Q&A forum.
It seems like there might be a couple of issues in your Dockerfile. Here's an updated version:
WORKDIR /app
# Copy the Go module files
COPY go.* ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o custom_handler .
# Final image based on Azure Functions runtime
FROM mcr.microsoft.com/azure-functions/go:3.0
WORKDIR /home/site/wwwroot
# Copy the compiled binary from the builder stage
COPY --from=builder /app/custom_handler ./
# Set the entrypoint to execute the function app
ENTRYPOINT ["./custom_handler"]
# Expose the port for HTTP triggers
EXPOSE 8080
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful