File tree Expand file tree Collapse file tree 4 files changed +80
-1
lines changed
docs/guides/dynamo_deploy Expand file tree Collapse file tree 4 files changed +80
-1
lines changed Original file line number Diff line number Diff line change 1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515
16+ # ######################################################################
17+ # 🚨 DEPRECATION NOTICE 🚨
18+ #
19+ # This Earthfile is being replaced by docker
20+ # This file is kept temporarily for backward compatibility but will
21+ # be removed in a future release. Please migrate to the new system.
22+ # ######################################################################
23+
1624VERSION 0.8
1725
1826# ############## ARTIFACTS TARGETS ##############################
Original file line number Diff line number Diff line change 1+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+ # SPDX-License-Identifier: Apache-2.0
3+
4+ # Base stage - Common setup for all stages
5+ FROM golang:1.24 AS base
6+
7+ # Docker buildx automatically provides these
8+ ARG TARGETOS=linux
9+ ARG TARGETARCH=amd64
10+
11+ RUN echo "Building for ${TARGETOS}/${TARGETARCH}"
12+
13+ # Install common dependencies
14+ RUN apt-get update && apt-get install -y git && apt-get clean && rm -rf /var/lib/apt/lists/*
15+
16+ WORKDIR /workspace
17+
18+ # Copy go mod and sum files first for better layer caching
19+ COPY go.mod go.sum ./
20+ RUN go mod download
21+
22+ # Copy source code
23+ COPY . .
24+
25+ # Lint stage
26+ FROM base AS linter
27+
28+ # Install golangci-lint using go install (builds with current Go version)
29+ RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
30+
31+ # Run linting
32+ RUN golangci-lint run --timeout=5m
33+
34+ # Test stage
35+ FROM base AS tester
36+
37+ # Install make if not present
38+ RUN apt-get update && apt-get install -y make && apt-get clean && rm -rf /var/lib/apt/lists/*
39+
40+ # Run tests using Makefile
41+ RUN make test
42+
43+ # Build stage - depends on successful lint and test
44+ FROM base AS builder
45+
46+ # Build the binary
47+ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o manager ./cmd/main.go
48+
49+ # Runtime stage
50+ FROM nvcr.io/nvidia/distroless/go:v3.1.12
51+ WORKDIR /
52+ COPY --from=builder /workspace/manager .
53+ USER 65532:65532
54+
55+ ENTRYPOINT ["./manager" ]
Original file line number Diff line number Diff line change 1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515
16+ # ######################################################################
17+ # 🚨 DEPRECATION NOTICE 🚨
18+ #
19+ # This Earthfile for the operator is being replaced by docker
20+ # This file is kept temporarily for backward compatibility but will
21+ # be removed in a future release. Please migrate to the new system.
22+ # ######################################################################
23+
1624VERSION 0.8
1725
1826# Base container for both build and test
Original file line number Diff line number Diff line change @@ -100,7 +100,15 @@ export IMAGE_TAG=${RELEASE_VERSION}
100100
101101# 2. Build operator
102102cd deploy/cloud/operator
103- earthly --push +docker --DOCKER_SERVER=$DOCKER_SERVER --IMAGE_TAG=$IMAGE_TAG
103+
104+ # 2.1 Alternative 1 : Build and push the operator image for multiple platforms
105+ docker buildx create --name multiplatform --driver docker-container --bootstrap
106+ docker buildx use multiplatform
107+ docker buildx build --platform linux/amd64,linux/arm64 -t $DOCKER_SERVER /dynamo-operator:$IMAGE_TAG --push .
108+
109+ # 2.2 Alternative 2 : Build and push the operator image for a single platform
110+ docker build -t $DOCKER_SERVER /dynamo-operator:$IMAGE_TAG . && docker push $DOCKER_SERVER /dynamo-operator:$IMAGE_TAG
111+
104112cd -
105113
106114# 3. Create namespace and secrets to be able to pull the operator image
You can’t perform that action at this time.
0 commit comments