Skip to content

Reduce docker image size #19

@asoorm

Description

@asoorm

We need to do some more work in order to reduce the docker image size for the gateway.

At the moment, it stands at 116mb

  1. We currently ship with 3 tyk binaries. Each binary is approx 32mb - py, grpc & lua. These should be separated into separate builds. e.g. tyk-gateway:py-2.7.3, tyk-gateway:grpc-2.7.3 or tyk-gateway:lua-2.7.3

  2. Currently we ship with base image debian:jessie-slim (30mb). We could look into using alpine which is a 2mb base image. If we require glibc https://github.com/sgerrand/alpine-pkg-glibc or if we may be better off using musl binaries.

  3. Strip debug info from compiled binaries using linker flags -s -w. go build -ldflags="-s -w" . which shaves off circa 10mb from each binary.

  4. Investigate using UPX to further pack the binaries - bringing binary size down to approx 5mb. https://github.com/upx/upx

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions