Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit 85928aa

Browse files
authored
Merge pull request #541 from DLTcollab/docker-uuid-pkgs
chore: add uuid-runtime package to docker image
2 parents c006446 + e45ddd1 commit 85928aa

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

WORKSPACE

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ git_repository(
2222
git_repository(
2323
name = "io_bazel_rules_docker",
2424
remote = "https://github.com/bazelbuild/rules_docker.git",
25-
tag = "v0.7.0",
25+
tag = "v0.9.0",
2626
)
2727

2828
load("@rules_iota//:defs.bzl", "iota_deps")
@@ -32,6 +32,15 @@ container_repositories()
3232

3333
load("@io_bazel_rules_docker//cc:image.bzl", _cc_image_repos = "repositories")
3434

35+
load("@io_bazel_rules_docker//container:pull.bzl", "container_pull")
36+
37+
container_pull(
38+
name = "ubuntu1804",
39+
registry = "l.gcr.io",
40+
repository = "google/ubuntu1804",
41+
tag = "latest",
42+
)
43+
3544
iota_deps()
3645

3746
third_party_deps()

accelerator/BUILD

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
load("@io_bazel_rules_docker//cc:image.bzl", "cc_image")
22
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
3+
load("@io_bazel_rules_docker//docker/package_managers:download_pkgs.bzl", "download_pkgs")
4+
load("@io_bazel_rules_docker//docker/package_managers:install_pkgs.bzl", "install_pkgs")
35

46
cc_binary(
57
name = "accelerator",
@@ -52,8 +54,25 @@ cc_library(
5254
srcs = ["cli_info.h"],
5355
)
5456

57+
download_pkgs(
58+
name = "docker_runtime_pkgs",
59+
image_tar = "@ubuntu1804//image",
60+
packages = [
61+
"uuid-runtime",
62+
],
63+
)
64+
65+
install_pkgs(
66+
name = "docker_runtime_image",
67+
image_tar = "@ubuntu1804//image",
68+
installables_tar = ":docker_runtime_pkgs.tar",
69+
installation_cleanup_commands = "rm -rf /var/lib/apt/lists/*",
70+
output_image_name = "docker_runtime_image",
71+
)
72+
5573
cc_image(
5674
name = "docker_base_image",
75+
base = ":docker_runtime_image",
5776
binary = ":accelerator",
5877
)
5978

0 commit comments

Comments
 (0)