| load("@io_bazel_rules_docker//container:container.bzl", "container_image") |
| load("@io_bazel_rules_docker//docker/util:run.bzl", "container_run_and_commit_layer") |
| |
| container_image( |
| name = "base", |
| base = "@basealpine//image", |
| tags = [ |
| "manual", # Exclusion from presubmit and RBE as it requires docker. |
| "no-remote", |
| ], |
| user = "root", |
| workdir = "/etc/temporal", |
| ) |
| |
| container_run_and_commit_layer( |
| name = "config", |
| # Temporal will need to generate yml file under config folder using |
| # environment vars. It needs root and access to the folder config. |
| commands = [ |
| "mkdir -p /etc/temporal/config", |
| "chmod ugo+w /etc/temporal/config", |
| "wget -O - https://github.com/jwilder/dockerize/releases/download/v0.7.0/dockerize-linux-amd64-v0.7.0.tar.gz | tar xzf - -C /usr/bin", |
| ], |
| image = ":base.tar", |
| tags = [ |
| "manual", # Exclusion from presubmit and RBE as it requires docker. |
| "no-remote", |
| ], |
| ) |
| |
| # Docker image with Temporal server and tools to admin the server. |
| container_image( |
| name = "temporal-server", |
| base = ":base.tar", |
| empty_files = [ |
| # The default dynamic config placeholder with empty content. |
| "/etc/temporal/config/dynamicconfig/docker.yaml", |
| ], |
| entrypoint = "/entrypoint.sh", |
| files = glob([ |
| "docker/*.sh", |
| "docker/*.yaml", |
| ]), |
| layers = [ |
| ":config", |
| ], |
| tags = [ |
| "manual", # Exclusion from presubmit and RBE as it requires docker. |
| "no-remote", |
| ], |
| tars = [ |
| "@com_github_temporal//:temporal", |
| "@com_github_temporal_cli//:temporal-cli", |
| ], |
| ) |
| |
| # Docker image with Temporal UI |
| # Launch with TEMPORAL_ADDRESS set to Temporal server, defaults to localhost. |
| container_image( |
| name = "temporal-ui", |
| base = ":base.tar", |
| entrypoint = "sh /etc/temporal/start-ui-server.sh", |
| layers = [ |
| ":config", |
| ], |
| tags = [ |
| "manual", # Exclusion from presubmit and RBE as it requires docker. |
| "no-remote", |
| ], |
| tars = [ |
| "@com_github_temporal_ui//:temporalui-pkg", |
| ], |
| ) |
| |
| genrule( |
| name = "temporal-cli", |
| srcs = [ |
| "@com_github_temporal_cli//:temporal-cli", |
| ], |
| outs = ["temporal-cli-bin"], |
| cmd = """ |
| tar -x -f $(location @com_github_temporal_cli//:temporal-cli) ./etc/temporal/temporal; |
| cp ./etc/temporal/temporal $@; |
| """, |
| executable = True, |
| tags = [ |
| "manual", # Exclusion from presubmit and RBE as it requires docker. |
| "no-remote", |
| ], |
| ) |