Skip to content

Commit

Permalink
TT-10430: migrate to gcr.io/distroless image
Browse files Browse the repository at this point in the history
  • Loading branch information
mitjaziv committed Nov 15, 2023
1 parent 6882761 commit aff2b8a
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,24 @@ ENV CGO_ENABLED=0

WORKDIR /go/src/github.com/TykTechnologies/mserv

# Add the sources
COPY . .

# Compile!
RUN go build -ldflags="-buildid= -w" -trimpath -v -o /bin/mserv
RUN mkdir -p /opt/mserv/downloads /opt/mserv/plugins

FROM debian:buster-slim AS runner

# Set some shell options for using pipes and such
SHELL [ "/bin/bash", "-euo", "pipefail", "-c" ]
FROM gcr.io/distroless/base:nonroot AS runner
USER 65532

ENV TYKVERSION 0.1
ENV TYK_MSERV_CONFIG /etc/mserv/mserv.json

LABEL Description="Tyk MServ service docker image" Vendor="Tyk" Version=$TYKVERSION

RUN mkdir -p /opt/mserv/downloads /opt/mserv/plugins

WORKDIR /opt/mserv

# Bring common CA certificates and binary over
# Bring common CA certificates and binary over.
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /bin/mserv /opt/mserv/mserv
COPY --from=builder /opt/mserv/downloads /opt/mserv/downloads
COPY --from=builder /opt/mserv/plugins /opt/mserv/plugins

ENTRYPOINT [ "/opt/mserv/mserv" ]

0 comments on commit aff2b8a

Please sign in to comment.