From 8c94ed487b33dc2b2a34975269508250f2213faa Mon Sep 17 00:00:00 2001 From: feedmeapples Date: Mon, 29 Nov 2021 17:13:52 -0500 Subject: [PATCH] Create dockerfile --- .gitignore | 3 +++ Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Dockerfile diff --git a/.gitignore b/.gitignore index 66fd13c9..98fec824 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ # Dependency directories (remove the comment below to include it) # vendor/ + +temporal +tctl \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..a42782d9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +ARG BASE_BUILDER_IMAGE=temporalio/base-builder:1.4.0 +ARG BASE_ADMIN_TOOLS_IMAGE=temporalio/base-admin-tools:1.2.0 +ARG GOPROXY + +##### Temporal Admin Tools builder ##### +FROM ${BASE_BUILDER_IMAGE} AS admin-tools-builder + +WORKDIR /home/builder + +# cache Temporal packages as a docker layer +COPY ./temporal/go.mod ./temporal/go.sum ./temporal/ +RUN (cd ./temporal && go mod download) + +# cache tctl packages as a docker layer +COPY ./tctl/go.mod ./tctl/go.sum ./tctl/ +RUN (cd ./tctl && go mod download) + +COPY ./temporal ./temporal +RUN (cd ./temporal && make bins) + +COPY ./tctl ./tctl +RUN (cd ./tctl && make build) + +##### Temporal admin tools ##### +FROM ${BASE_ADMIN_TOOLS_IMAGE} as temporal-admin-tools +WORKDIR /etc/temporal + +COPY --from=admin-tools-builder /home/builder/temporal/schema /etc/temporal/schema +COPY --from=admin-tools-builder /home/builder/temporal/temporal-cassandra-tool /usr/local/bin +COPY --from=admin-tools-builder /home/builder/temporal/temporal-sql-tool /usr/local/bin +COPY --from=admin-tools-builder /home/builder/tctl/tctl /usr/local/bin +COPY --from=admin-tools-builder /home/builder/tctl/tctl-authorization-plugin /usr/local/bin + +# Keep the container running. +ENTRYPOINT ["tail", "-f", "/dev/null"]