-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (33 loc) · 1.34 KB
/
Dockerfile
File metadata and controls
48 lines (33 loc) · 1.34 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
ARG BASE_IMAGE=tykio/golang-cross:1.25-bullseye
FROM ${BASE_IMAGE}
LABEL description="Image for plugin development"
ENV TYK_GW_PATH=/go/src/github.com/TykTechnologies/tyk
ENV GO111MODULE=on
# This directory will contain the plugin source and will be
# mounted from the host box by the user using docker volumes
ENV PLUGIN_SOURCE_PATH=/plugin-source
RUN mkdir -p $TYK_GW_PATH $PLUGIN_SOURCE_PATH
# remove for avoiding CVEs
RUN apt-get purge -y --allow-remove-essential --auto-remove wget curl automake cmake python* docker* libsqlite* qemu* \
&& rm -f /usr/bin/passwd /usr/sbin/adduser /usr/bin/goreleaser
ADD go.mod go.sum $TYK_GW_PATH
WORKDIR $TYK_GW_PATH
RUN --mount=type=cache,mode=0755,target=/go/pkg/mod \
--mount=type=cache,mode=0755,target=/root/.cache/go-build \
go mod download
ADD . $TYK_GW_PATH
ARG GITHUB_SHA
ARG GITHUB_TAG
ENV GITHUB_SHA=${GITHUB_SHA}
ENV GITHUB_TAG=${GITHUB_TAG}
ARG BUILD_TAG
ENV BUILD_TAG=${BUILD_TAG}
ARG GOFIPS140
ENV GOFIPS140=${GOFIPS140}
# Provide a gateway test binary for testing plugin loading.
RUN --mount=type=cache,mode=0755,target=/go/pkg/mod \
--mount=type=cache,mode=0755,target=/root/.cache/go-build \
GOBIN=/usr/local/bin go install -tags=goplugin${BUILD_TAG:+,$BUILD_TAG} -trimpath .
COPY ci/images/plugin-compiler/data/build.sh /build.sh
RUN chmod +x /build.sh
ENTRYPOINT ["/build.sh"]