diff --git a/Makefile b/Makefile index cf41c4f2e..3e7b856ea 100644 --- a/Makefile +++ b/Makefile @@ -287,9 +287,13 @@ push-openstack-populator-image: build-openstack-populator-image $(CONTAINER_CMD) push $(OPENSTACK_POPULATOR_IMAGE) build-ova-provider-server-image: check_container_runtime - $(CONTAINER_CMD) build -f hack/ova-provider-server/Containerfile -t $(OVA_PROVIDER_SERVER_IMAGE) . + export CONTAINER_CMD=$(CONTAINER_CMD); \ + bazel run cmd/ova-provider-server:ova-provider-server-image \ + $(BAZEL_OPTS) \ + --action_env CONTAINER_CMD=$(CONTAINER_CMD) push-ova-provider-server-image: build-ova-provider-server-image + $(CONTAINER_CMD) tag bazel/cmd/ova-provider-server:ova-provider-server-image $(OVA_PROVIDER_SERVER_IMAGE) $(CONTAINER_CMD) push $(OVA_PROVIDER_SERVER_IMAGE) build-all-images: build-api-image \ diff --git a/cmd/ova-provider-server/BUILD.bazel b/cmd/ova-provider-server/BUILD.bazel index 0452abde8..ec8e86e58 100644 --- a/cmd/ova-provider-server/BUILD.bazel +++ b/cmd/ova-provider-server/BUILD.bazel @@ -19,15 +19,18 @@ load( "container_image", ) -container_image( - name = "ova-provider-server-image", - base = "@ova-provider-server-image-dockerfile//image:dockerfile_image.tar", - visibility = ["//visibility:public"], -) - go_test( name = "ova-provider-server_test", srcs = ["nfs_test.go"], embed = [":ova-provider-server_lib"], deps = ["//vendor/github.com/onsi/gomega"], ) + +container_image( + name = "ova-provider-server-image", + base = "@ubi9-minimal//image", + directory = "/usr/local/bin/", + entrypoint = ["/usr/local/bin/ova-provider-server"], + files = [":ova-provider-server"], + visibility = ["//visibility:public"], +) diff --git a/hack/ova-provider-server/BUILD.bazel b/hack/ova-provider-server/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/hack/ova-provider-server/Containerfile b/hack/ova-provider-server/Containerfile deleted file mode 100644 index 52e504ff1..000000000 --- a/hack/ova-provider-server/Containerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM registry.access.redhat.com/ubi9/go-toolset:1.19.10-4 as builder -ENV GOPATH=$APP_ROOT -COPY . . -RUN CGO_ENABLED=0 go build -buildvcs=false -o ova-provider-server github.com/konveyor/forklift-controller/cmd/ova-provider-server - -FROM quay.io/centos/centos:stream9-minimal -COPY --from=builder /opt/app-root/src/ova-provider-server /usr/local/bin/ova-provider-server -ENTRYPOINT ["/usr/local/bin/ova-provider-server"] \ No newline at end of file diff --git a/hack/ovirt-populator/Containerfile b/hack/ovirt-populator/Containerfile deleted file mode 100644 index cb3dd1de7..000000000 --- a/hack/ovirt-populator/Containerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM registry.access.redhat.com/ubi8/go-toolset:1.18.9-8 as builder -ENV GOPATH=$APP_ROOT - -COPY go.mod ./ -COPY go.sum ./ -COPY cmd/ovirt-populator/ovirt-populator.go ./ -COPY vendor/ ./vendor/ -# When debugging by replacing the lib-volume-populator with a local modified copy -# COPY . ./ - -RUN CGO_ENABLED=0 go build -o ovirt-populator - -FROM quay.io/centos/centos:stream9-minimal -COPY --from=builder /opt/app-root/src/ovirt-populator /usr/local/bin -RUN microdnf install -y gcc python3-pip python3-devel libxml2-devel openssl-devel libcurl-devel qemu-img && microdnf clean all -RUN pip install ovirt-engine-sdk-python ovirt-imageio - -ENTRYPOINT ["/usr/local/bin/ovirt-populator"] diff --git a/openstack_populator_containerfile b/openstack_populator_containerfile deleted file mode 120000 index 9c39e2b0d..000000000 --- a/openstack_populator_containerfile +++ /dev/null @@ -1 +0,0 @@ -hack/openstack-populator/Containerfile \ No newline at end of file diff --git a/ova_provider_server_containerfile b/ova_provider_server_containerfile deleted file mode 120000 index ba6f3166f..000000000 --- a/ova_provider_server_containerfile +++ /dev/null @@ -1 +0,0 @@ -hack/ova-provider-server/Containerfile \ No newline at end of file diff --git a/ovirt_populator_containerfile b/ovirt_populator_containerfile deleted file mode 120000 index ed2c43407..000000000 --- a/ovirt_populator_containerfile +++ /dev/null @@ -1 +0,0 @@ -hack/ovirt-populator/Containerfile \ No newline at end of file