Skip to content

Commit

Permalink
Try to fix "/cmd/main.go": no such file or directory
Browse files Browse the repository at this point in the history
Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>
  • Loading branch information
tmihalac committed Jan 14, 2025
1 parent 4dfa3ec commit cc88092
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions infra/feast-operator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
# Build the manager binary
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:1.22 AS builder
FROM registry.access.redhat.com/ubi9/go-toolset:1.21 AS builder
ARG TARGETOS
ARG TARGETARCH

WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

USER root

COPY ["Makefile", "./"]

RUN pwd && echo sdfljsdfljksdfljk1
RUN ls && echo sdfljsdfljksdfljk1
RUN ls /tmp/build/inputs && echo sdfljsdfljksdfljk1

# Copy the go source
COPY cmd/ cmd/
RUN ls && echo sdfljsdfljksdfljk
COPY cmd/main.go cmd/main.go
COPY api/ api/
COPY internal/ internal/
COPY internal/controller/ internal/controller/

# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
Expand All @@ -32,11 +26,9 @@ COPY internal/ internal/
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
FROM registry.access.redhat.com/ubi9/ubi-micro:9.5
WORKDIR /
COPY --from=builder /workspace/manager .
COPY --from=builder /opt/app-root/src/manager .
USER 65532:65532

ENTRYPOINT ["/manager"]
ENTRYPOINT ["/manager"]

0 comments on commit cc88092

Please sign in to comment.