Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D docker-snowflake-proxy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Anti-censorship
  • docker-snowflake-proxy
  • Merge requests
  • !1

Draft: Rearchitecture Dockerfile to create smaller image

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Ridhwan Ikhwanto requested to merge halfpantograph/docker-snowflake-proxy:rearch-alpine into main Aug 26, 2021
  • Overview 8
  • Commits 7
  • Pipelines 0
  • Changes 2

The current Docker image for Snowflake proxy is gigantic at 319.83 MB compressed and 905 MB on disk. As most of this is space usage are Golang package (installing golang-go on Debian itself takes nearly 700 MB on disk) and build dependencies, I think we need to do different approach at making this image. It also helps that binaries compiled by Go on default settings don't need any runtime dependencies, so we can just strip everything down.

So I rearchitectured the Dockerfile to do an entirely different way of building the image: instead of using golang as base image, I started with the lightweight Alpine Linux. Then I installed golang and every other build dependencies, then download Snowflake's tarball, extract and compile it and put it in /usr/local/bin. Finally, I just removed the tarball, extracted tarball and every build dependencies.

This resulted in a massively smaller image at only 13 MB compressed and about 30 MB on disk. You can check out my Docker Hub to see my build results.

I also removed the hardcoded addresses from ENTRYPOINT so proxy operators can provide the settings themselves by adding a command: line in docker-compose.yml or when running docker run or just use the default settings. So this will also close #1 (closed)

If using Alpine Linux is not something we are fond of, I also created a similar one but using Debian as the base image. But Debian creates a significantly larger image at about 50 MB compressed and about 130 MB on disk.

Edited Aug 26, 2021 by Ridhwan Ikhwanto
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: rearch-alpine