Skip to content

Suggested Dockerfile improvements

guest42069 requested to merge guest42069/docker-snowflake-proxy:main into main

Improvements:

  • separate out go mod download to utilise build cache.
  • explicit in source repo for golang builder image (other container runtimes may not default to docker.io).
  • switch to UID 1000 to help reduce privileges of the running binary in the container to reduce potential container escape attack surface.
  • -w -s in the go build step to strip out debugging symbols to reduce binary size.
  • default to main as VERSION.
  • shallow git clone with --depth=1 since we don't need a full git history to perform a build.
  • golang 1.17 rather than 1.15, some improvements in runtime performance and binary size.

Merge request reports

Loading