Creation of Temporal Docker image

Hi everyone,
We’ve made some changes to the Temporal server codebase and can successfully run the server with the changes on local setup. We tried to build a Temporal server image with the new changes by following these steps:

  1. cloned the GitHub - temporalio/docker-builds: Temporal service Docker images build folder and put the Temporal server code with our changes in it.
  2. ran the docker build . -f server.Dockerfile -t server:1.21.3 command to build the server image.

When we tried to deploy the server using the image containing our changes, deploy is succeesful as shown in picture 1. However, we couldn’t bring up the frontend, history, matching, and worker containers, as shown is the picture 2.
Can you please validation if the approach is correct? please suggest a solution on how to bring up these containers.

logs: docker build . -f server.Dockerfile -t server:1.21.3
Sending build context to Docker daemon 340.8MB
Step 1/38 : ARG BASE_BUILDER_IMAGE=temporalio/base-builder:1.14.4
Step 2/38 : ARG BASE_SERVER_IMAGE=temporalio/base-server:1.15.4
Step 3/38 : FROM ${BASE_BUILDER_IMAGE} AS temporal-builder
—> f2ae30f545fd
—> Using cache
—> 1987f99c1656
Step 5/38 : WORKDIR /home/builder
—> Using cache
—> 48e2d4048879
Step 6/38 : COPY ./temporal/go.mod ./temporal/go.sum ./temporal/
—> Using cache
—> bfc26bd8a1f5
Step 7/38 : RUN (cd ./temporal && go mod download all)
—> Using cache
—> 6320901d3328
Step 8/38 : COPY ./tctl/go.mod ./tctl/go.sum ./tctl/
—> 1b690529e6d4
Step 9/38 : RUN (cd ./tctl && go mod download all)
—> Running in f90c36846f46
Removing intermediate container f90c36846f46
—> c9bf1f940dcd
Step 10/38 : RUN sh -c “$(curl -sSf” – --dir ./cli --version “$TEMPORAL_CLI_VERSION” && mv ./cli/bin/temporal ./cli/ && chown 0:0 ./cli/temporal
—> Running in 58c46a01d8f6
temporal: Downloading Temporal CLI latest
temporal: Temporal CLI installed at ./cli/bin/temporal
temporal: For convenience, we recommend adding it to your PATH
temporal: If using bash, run echo export PATH=“$PATH:./cli/bin” >> ~/.bashrc
Removing intermediate container 58c46a01d8f6
—> b339a2577150
Step 11/38 : COPY ./tctl ./tctl
—> 6b701823fa2c
Step 12/38 : COPY ./temporal ./temporal
—> c713e907138c
Step 13/38 : COPY ./.git ./.git
—> 18e26b6f2f99
Step 14/38 : COPY ./.gitmodules ./.gitmodules
—> 63ea50a899ac
Step 15/38 : RUN (cd ./temporal && make temporal-server)
—> Running in 9f95e0f7e0e6
fatal: Not a valid object name master
make: ‘temporal-server’ is up to date.
Removing intermediate container 9f95e0f7e0e6
—> ea9a95d51cbb
Step 16/38 : RUN (cd ./tctl && make build)
—> Running in 17ef0d8a4f39
Build tctl with OS: linux, ARCH: amd64…
CGO_ENABLED=0 go build ./cmd/tctl
Build tctl-authorization-plugin with OS: linux, ARCH: amd64…
CGO_ENABLED= go build ./cmd/plugins/tctl-authorization-plugin
Removing intermediate container 17ef0d8a4f39
—> f96eb3c1346c
Step 17/38 : FROM ${BASE_SERVER_IMAGE} as temporal-server
1.15.4: Pulling from temporalio/base-server
96526aa774ef: Already exists
7d3271d0f3f4: Pull complete
4ef256a573d6: Pull complete
Digest: sha256:e31de69b452e1501711982677fff63074e85c93ad4726340cbb7b953d14b9ed2
Status: Downloaded newer image for temporalio/base-server:1.15.4
—> edf473182e3b
Step 18/38 : ARG TEMPORAL_SHA=unknown
—> Running in 99905513cf79
Removing intermediate container 99905513cf79
—> 12da2f1196ac
Step 19/38 : ARG TCTL_SHA=unknown
—> Running in 2433a00c2f5a
Removing intermediate container 2433a00c2f5a
—> d41e922918e1
Step 20/38 : WORKDIR /etc/temporal
—> Running in 7dd5db453f20
Removing intermediate container 7dd5db453f20
—> f9c1fc8a3230
Step 21/38 : ENV TEMPORAL_HOME=/etc/temporal
—> Running in 78e8d43d10da
Removing intermediate container 78e8d43d10da
—> 0049c59bdaa7
Step 22/38 : EXPOSE 6933 6934 6935 6939 7233 7234 7235 7239
—> Running in 7e256055603c
Removing intermediate container 7e256055603c
—> 31db39266152
Step 23/38 : RUN addgroup -g 1000 temporal
—> Running in 57f846952062
Removing intermediate container 57f846952062
—> da0308fc8bb1
Step 24/38 : RUN adduser -u 1000 -G temporal -D temporal
—> Running in f65adb332a3f
Removing intermediate container f65adb332a3f
—> aa32fd397470
Step 25/38 : RUN mkdir /etc/temporal/config
—> Running in c5f0f12520f6
Removing intermediate container c5f0f12520f6
—> a0a6a0c56cb3
Step 26/38 : RUN chown -R temporal:temporal /etc/temporal/config
—> Running in 6a9bb84dd44c
Removing intermediate container 6a9bb84dd44c
—> 2d0400df55bb
Step 27/38 : USER temporal
—> Running in 64ea4e0c1b86
Removing intermediate container 64ea4e0c1b86
—> 114732f30171
—> Running in b7e48d92d0b4
Removing intermediate container b7e48d92d0b4
—> 6bf79d70520c
Step 29/38 : ENV TCTL_SHA=${TCTL_SHA}
—> Running in b774251abe51
Removing intermediate container b774251abe51
—> b801ff347519
Step 30/38 : COPY --from=temporal-builder /home/builder/tctl/tctl /usr/local/bin
—> fed9b17dce9f
Step 31/38 : COPY --from=temporal-builder /home/builder/tctl/tctl-authorization-plugin /usr/local/bin
—> 65a0d2df2ebd
Step 32/38 : COPY --from=temporal-builder /home/builder/temporal/temporal-server /usr/local/bin
—> 90828fe4966d
Step 33/38 : COPY --from=temporal-builder /home/builder/cli/temporal /usr/local/bin
—> bb823a0324a3
Step 34/38 : COPY ./temporal/config/dynamicconfig/docker.yaml /etc/temporal/config/dynamicconfig/docker.yaml
—> 6b50e966cb31
Step 35/38 : COPY ./temporal/docker/config_template.yaml /etc/temporal/config/config_template.yaml
—> af278c8d5029
Step 36/38 : COPY ./docker/ /etc/temporal/
—> aae5126ef079
Step 37/38 : COPY ./docker/ /etc/temporal/
—> ef9cf565c6b7
Step 38/38 : ENTRYPOINT [“/etc/temporal/”]
—> Running in 55115f2a860d
Removing intermediate container 55115f2a860d
—> 8ce84497996b
Successfully built 8ce84497996b
Successfully tagged server:1.21.3


I also working on similar use case, anyone know whether it’s the correct method to build temporal server by ourselves?

Hi @Mahith @xuejie

Is this all you get in server logs?

Have you tested if your deployment work building the server without any modification?

Hi Antonio,
Thank you for the reply. I finally find I first need to delete the binaries in temporal folder that generated when I run locally using make command, since it’s Darwin format and we need Linux format for docker run. It will make Linux format binaries during build process, but if there are already binaries, it willl skip the steps and won’t overwrite