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

Prevent docker build warnings and fix dev CONTAINER_REPO and double container building #346

Merged
merged 3 commits into from
Sep 13, 2024
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
38 changes: 19 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -229,23 +229,23 @@ install: deploy-cluster dev-infra deploy-elasticoperator deploy-arangodb-crds ad

@echo "deploying dracon"
@helm upgrade dracon ./deploy/dracon/chart \
--install \
--values ./deploy/dracon/values/dev.yaml \
--create-namespace \
--set "image.registry=$(CONTAINER_REPO)" \
--namespace $(DRACON_NS) \
--version $(DRACON_VERSION) \
--wait
--install \
--values ./deploy/dracon/values/dev.yaml \
--create-namespace \
--set "image.registry=$(CONTAINER_REPO)" \
--namespace $(DRACON_NS) \
--version $(DRACON_VERSION) \
--wait

@echo "Applying migrations"
@helm upgrade deduplication-db-migrations ./deploy/deduplication-db-migrations/chart \
--install \
--values ./deploy/deduplication-db-migrations/values/dev.yaml \
--create-namespace \
--set "image.registry=$(CONTAINER_REPO)" \
--namespace $(DRACON_NS) \
--set "image.tag=$(DRACON_VERSION)" \
--wait
--install \
--values ./deploy/deduplication-db-migrations/values/dev.yaml \
--create-namespace \
--set "image.registry=$(CONTAINER_REPO)" \
--namespace $(DRACON_NS) \
--set "image.tag=$(DRACON_VERSION)" \
--wait

@echo "Installing Components"
# we are setting the container repo to it's own value so that we can override it from other make targets
Expand All @@ -269,7 +269,7 @@ install-oss-components:

dev-build-oss-components: cmd/draconctl/bin
@echo "Building open-source components for local dracon instance..."
$(eval CONTAINER_REPO:=localhost:5000)
$(eval CONTAINER_REPO:=localhost:5000/ocurity/dracon)

$(MAKE) -j 16 publish-component-containers CONTAINER_REPO=$(CONTAINER_REPO)
@./bin/cmd/draconctl components package \
Expand All @@ -279,11 +279,11 @@ dev-build-oss-components: cmd/draconctl/bin
./components

dev-dracon:
$(eval CONTAINER_REPO:=localhost:5000)
$(eval CONTAINER_REPO:=localhost:5000/ocurity/dracon)
$(eval DRACON_OSS_COMPONENTS_PACKAGE_URL:=./$(DRACON_OSS_COMPONENTS_NAME)-$(DRACON_VERSION).tgz)
$(eval IN_CLUSTER_CONTAINER_REPO:=kind-registry:5000)
$(MAKE) -j 16 publish-containers CONTAINER_REPO=$(CONTAINER_REPO)
$(eval IN_CLUSTER_CONTAINER_REPO:=kind-registry:5000/ocurity/dracon)

$(MAKE) -j 16 draconctl-image-publish CONTAINER_REPO=$(CONTAINER_REPO)
$(MAKE) -j 16 dev-build-oss-components CONTAINER_REPO=$(CONTAINER_REPO)

$(MAKE) install CONTAINER_REPO=$(IN_CLUSTER_CONTAINER_REPO) DRACON_OSS_COMPONENTS_PACKAGE_URL=$(DRACON_OSS_COMPONENTS_PACKAGE_URL)
Expand Down
4 changes: 2 additions & 2 deletions containers/Dockerfile.draconctl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG BASE_MIGRATION_IMAGE
FROM ${BASE_MIGRATION_IMAGE:-scratch}

LABEL org.opencontainers.image.description "Draconctl is a command line tool for interacting with Dracon, you can find documentation for it at github.com/ocurity/dracon"
LABEL org.opencontainers.image.description="Draconctl is a command line tool for interacting with Dracon, you can find documentation for it at github.com/ocurity/dracon"

COPY ./bin/cmd/draconctl /bin/draconctl
COPY ./pkg/enrichment/migrations /etc/dracon/migrations/enrichment

ENTRYPOINT [ "/bin/draconctl" ]
ENTRYPOINT ["/bin/draconctl"]
4 changes: 2 additions & 2 deletions scripts/build_component_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ else
dockerfile_template="
FROM ${BASE_IMAGE:-scratch} \n
COPY ${executable_path} /app/${executable_path} \n
ENTRYPOINT ["/app/${executable_path}"] \n
ENTRYPOINT [\"/app/${executable_path}\"] \n
"
dockerfile_path=$(mktemp)
printf "${dockerfile_template}" > "${dockerfile_path}"
docker build -t "${CONTAINER_REPO}/${executable_src_path}:${DRACON_VERSION}" \
docker --debug build -t "${CONTAINER_REPO}/${executable_src_path}:${DRACON_VERSION}" \
$([ "${SOURCE_CODE_REPO}" != "" ] && echo "--label=org.opencontainers.image.source=${SOURCE_CODE_REPO}" ) \
-f "${dockerfile_path}" ./bin
fi
Expand Down
Loading