Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2.9] VEX related improvements in the build process #805

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ $(SETUP_ENVTEST):

.PHONY: operator
operator:
CGO_ENABLED=0 go build -o bin/aks-operator main.go
CGO_ENABLED=0 go build -ldflags \
"-X github.com/rancher/aks-operator/pkg/version.GitCommit=$(GIT_COMMIT) \
-X github.com/rancher/aks-operator/pkg/version.Version=$(TAG)" \
-o bin/aks-operator .

.PHONY: generate-go
generate-go: $(MOCKGEN)
Expand Down Expand Up @@ -139,7 +142,7 @@ buildx-machine: ## create rancher dockerbuildx machine targeting platform define
.PHONY: image-build
image-build: buildx-machine ## build (and load) the container image targeting the current platform.
docker buildx build -f package/Dockerfile \
--builder $(MACHINE) --build-arg VERSION=$(TAG) \
--builder $(MACHINE) --build-arg COMMIT=$(GIT_COMMIT) --build-arg VERSION=$(TAG) \
-t "$(IMAGE)" $(BUILD_ACTION) .
@echo "Built $(IMAGE)"

Expand Down
8 changes: 7 additions & 1 deletion package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ COPY ./main.go ./main.go
COPY --from=xx / /

ARG TARGETPLATFORM
ARG COMMIT
ARG VERSION
ENV CGO_ENABLED=0
RUN xx-go build -o /aks-operator && xx-verify /aks-operator
RUN xx-go build -ldflags \
"-X github.com/rancher/aks-operator/pkg/version.GitCommit=${COMMIT} \
-X github.com/rancher/aks-operator/pkg/version.Version=${VERSION}" \
-o /aks-operator && \
xx-verify /aks-operator

FROM registry.suse.com/bci/bci-micro:15.6
COPY --from=base /etc/passwd /etc/passwd
Expand Down
Loading