-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Dockerfile
33 lines (22 loc) · 963 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
ARG GO_VERSION=1.23
FROM golang:${GO_VERSION}-bullseye
# Build essentials
RUN apt update && apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl wget libbz2-dev -y
## This just installs whatever is is bullseye, makes docker build (fast/small)-(er)
RUN apt install python3 -y
# Build gateway
RUN mkdir /opt/tyk-gateway
WORKDIR /opt/tyk-gateway
ADD go.mod go.sum /opt/tyk-gateway/
RUN --mount=type=cache,mode=0755,target=/go/pkg/mod \
--mount=type=cache,mode=0755,target=/root/.cache/go-build \
go mod download
ADD . /opt/tyk-gateway
RUN --mount=type=cache,mode=0755,target=/go/pkg/mod \
--mount=type=cache,mode=0755,target=/root/.cache/go-build \
make build
COPY tyk.conf.example tyk.conf
RUN echo "Tyk: $(/opt/tyk-gateway/tyk --version 2>&1)" && \
echo "Go: $(go version)" && \
echo "Python: $(python3 --version)"
ENTRYPOINT ["/opt/tyk-gateway/tyk"]