docker_image: add custom docker_image macro building and pushing docker images
diff --git a/apps/face_detection/BUILD b/apps/face_detection/BUILD
index d1ed253..c966548 100644
--- a/apps/face_detection/BUILD
+++ b/apps/face_detection/BUILD
@@ -1,22 +1,14 @@
-load("@rules_pkg//:pkg.bzl", "pkg_tar")
+load("//:bazel_tools/docker.bzl", "docker_image")
# TODO(lekva): figure out how to build py_binary with pip dependencies and
-# migrate off of shell script running docker build
-sh_binary(
+# migrate off docker_image rule
+docker_image(
name = "push_to_dev",
- srcs = ["push_to_dev.sh"],
- data = glob(["*.py"]) + [
- "Dockerfile",
+ registry = "localhost:30500",
+ image = "giolekva/face-detector",
+ tag = "latest",
+ dockerfile = "Dockerfile",
+ srcs = glob(["*.py"]) + [
"haarcascade_frontalface_default.xml",
],
- deps = [
- "@bazel_tools//tools/bash/runfiles",
- ],
-)
-
-pkg_tar(
- name = "chart",
- srcs = glob(["chart/**"]),
- extension = "tar.gz",
- strip_prefix = "./chart",
)
diff --git a/apps/face_detection/Dockerfile b/apps/face_detection/Dockerfile
index befcba5..8c0996c 100644
--- a/apps/face_detection/Dockerfile
+++ b/apps/face_detection/Dockerfile
@@ -15,4 +15,5 @@
python3-opencv
WORKDIR /app
-COPY . /app
\ No newline at end of file
+COPY *.py /app/
+COPY *.xml /app/