@@ -2,7 +2,45 @@ ARG TARGET=server
2
2
ARG GOPROXY
3
3
4
4
# #### Temporal builder #####
5
- FROM temporalio/base-builder:1.2.0 AS temporal-builder
5
+ FROM golang:1.16-alpine AS base-builder
6
+
7
+ RUN apk add --update --no-cache \
8
+ make \
9
+ git \
10
+ protobuf \
11
+ build-base
12
+
13
+
14
+ # #### dockerize builder: built from source to support arm & x86 #####
15
+ FROM base-builder AS dockerize-builder
16
+ RUN mkdir -p /xsrc && \
17
+ git clone https://github.com/jwilder/dockerize.git && \
18
+ cd dockerize && \
19
+ go mod init github.com/jwilder/dockerize && \
20
+ go mod tidy && \
21
+ go build -o /usr/local/bin/dockerize .
22
+
23
+ # #### base server image #####
24
+ FROM alpine:3.12 AS base-server
25
+
26
+ RUN apk add --update --no-cache \
27
+ ca-certificates \
28
+ openssl \
29
+ bash \
30
+ curl \
31
+ vim
32
+
33
+ # set up nsswitch.conf for Go's "netgo" implementation
34
+ # https://github.com/gliderlabs/docker-alpine/issues/367#issuecomment-424546457
35
+ RUN test ! -e /etc/nsswitch.conf && echo 'hosts: files dns' > /etc/nsswitch.conf
36
+ COPY --from=dockerize-builder /usr/local/bin/dockerize /usr/local/bin/dockerize
37
+ SHELL ["/bin/bash" , "-c" ]
38
+
39
+ # #### temporal-base-server target #####
40
+ FROM base-server AS temporal-base-server
41
+
42
+ # #### temporal-builder target #####
43
+ FROM base-builder AS temporal-builder
6
44
7
45
WORKDIR /temporal
8
46
@@ -12,8 +50,8 @@ RUN go mod download
12
50
COPY . .
13
51
RUN make bins
14
52
15
- # #### Temporal server #####
16
- FROM temporalio/ base-server:1.0.0 AS temporal-server
53
+ # #### temporal- server target #####
54
+ FROM temporal- base-server AS temporal-server
17
55
WORKDIR /etc/temporal
18
56
ENV TEMPORAL_HOME /etc/temporal
19
57
ENV SERVICES "history:matching:frontend:worker"
@@ -48,13 +86,13 @@ CMD ["autosetup", "develop"]
48
86
COPY docker/setup-develop.sh /etc/temporal/setup-develop.sh
49
87
50
88
# #### Temporal CLI (tctl) #####
51
- FROM temporalio/ base-server:1.0.0 AS temporal-tctl
89
+ FROM temporal- base-server AS temporal-tctl
52
90
WORKDIR /etc/temporal
53
91
ENTRYPOINT ["tctl" ]
54
92
COPY --from=temporal-builder /temporal/tctl /usr/local/bin
55
93
56
94
# #### Temporal admin tools #####
57
- FROM temporalio/ base-admin-tools:1.0.0 as temporal-admin-tools
95
+ FROM temporal- base-server as temporal-admin-tools
58
96
WORKDIR /etc/temporal
59
97
# Keep the container running.
60
98
ENTRYPOINT ["tail" , "-f" , "/dev/null" ]
0 commit comments