Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

How to build a Docker image from source code now? #735

Discussion options

I noticed that in the latest version of the project, the docker-build target has been removed from the Makefile. Previously, I used this target to build the source code into a Docker image. Is there an alternative way to build the project as a Docker image now? I have changed some code and now want to test.

Are there new recommended commands or scripts for this process? Any guidance would be appreciated.

You must be logged in to vote

With #560 we migrated to ko which provides OCI artifacts.

By default, make build will generate a ko build for OCI, such as container images. By default, the KO_LOCAL variable is set to false, meaning you can use Skopeo or kind load docker-image.

If you want to push to your container registry, you can run something as:

make CONTAINER_REPOSITORY=your.container.registry.tld KO_PUSH=true build

Result will be something as:

LD_FLAGS="-X github.com/clastix/kamaji/internal.GitCommit=$(git rev-parse --short HEAD) -X github.com/clastix/kamaji/internal.GitTag=edge-25.03.1 -X github.com/clastix/kamaji/internal.GitDirty=$(echo "$(git diff $(git rev-parse --short HEAD) $(git rev-parse --short edge-25.…

Replies: 1 comment · 2 replies

Comment options

With #560 we migrated to ko which provides OCI artifacts.

By default, make build will generate a ko build for OCI, such as container images. By default, the KO_LOCAL variable is set to false, meaning you can use Skopeo or kind load docker-image.

If you want to push to your container registry, you can run something as:

make CONTAINER_REPOSITORY=your.container.registry.tld KO_PUSH=true build

Result will be something as:

LD_FLAGS="-X github.com/clastix/kamaji/internal.GitCommit=$(git rev-parse --short HEAD) -X github.com/clastix/kamaji/internal.GitTag=edge-25.03.1 -X github.com/clastix/kamaji/internal.GitDirty=$(echo "$(git diff $(git rev-parse --short HEAD) $(git rev-parse --short edge-25.03.1) --quiet && echo "" || echo ".dev")$(git diff --quiet && echo "" || echo ".dirty")") -X github.com/clastix/kamaji/internal.BuildTime=$(git log -1 --format="%at" | xargs -I{} date -d @{} +%Y-%m-%dT%H:%M:%S) -X github.com/clastix/kamaji/internal.GitRepo=$(git config --get remote.origin.url)" \
KOCACHE=/tmp/ko-cache KO_DOCKER_REPO=your.container.registry.tld \
/home/prometherion/Documents/clastix/kamaji/bin/ko build ./ --bare --tags=edge-25.03.1 --local=true --push=true
You must be logged in to vote
2 replies
@buzzlightyear2k
Comment options

Do you know how to generate new generate new manifest file to apply when i change the CRD ? I found those manifest in kamaji/charts/kamaji/crds but dont known how to regenerate those files when i make change to the CRD

@prometherion
Comment options

kamaji/Makefile

Lines 131 to 134 in 09a5b05

crds: controller-gen yq
$(CONTROLLER_GEN) crd webhook paths="./..." output:stdout | $(YQ) 'select(documentIndex == 0)' > ./charts/kamaji/crds/kamaji.clastix.io_datastores.yaml
$(CONTROLLER_GEN) crd webhook paths="./..." output:stdout | $(YQ) 'select(documentIndex == 1)' > ./charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml
$(YQ) -i '. *n load("./charts/kamaji/controller-gen/crd-conversion.yaml")' ./charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml

Answer selected by buzzlightyear2k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #731 on March 20, 2025 16:53.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.