---
title: "Fly With Alpine"
description: "Alpine Linux can reduce container image sizes compared with Debian slim, but switching distributions involves compatibility and ecosystem trade-offs. The post compares Fly.io’s Debian-based baseline across Bun, Node, Python, and Ruby, then reports smaller Alpine base and application images, including 304MB versus 428MB for a minimal Rails/Postgresql/esbuild application. Migration consists of changing Dockerfile base images from -slim to -alpine, replacing apt-get with apk, and reviewing package-name differences; recent Bun, Node, and Rails generators can make these changes with an --alpine option. Alpine uses musl rather than Debian’s glibc, and issues can involve DNS, missing commands or packages, precompiled binaries, insufficient testing of release candidates, and software such as Chrome. Fly.io will retain Debian as its default while keeping Alpine available."
---

# Fly With Alpine

[Fly.io](https://yomu.fyi/company/fly-io) · Dec 21, 2023

**Type:** Explainer

## Summary

Alpine Linux can reduce container image sizes compared with Debian slim, but switching distributions involves compatibility and ecosystem trade-offs. The post compares Fly.io’s Debian-based baseline across Bun, Node, Python, and Ruby, then reports smaller Alpine base and application images, including 304MB versus 428MB for a minimal Rails/Postgresql/esbuild application. Migration consists of changing Dockerfile base images from -slim to -alpine, replacing apt-get with apk, and reviewing package-name differences; recent Bun, Node, and Rails generators can make these changes with an --alpine option. Alpine uses musl rather than Debian’s glibc, and issues can involve DNS, missing commands or packages, precompiled binaries, insufficient testing of release candidates, and software such as Chrome. Fly.io will retain Debian as its default while keeping Alpine available.

## Context

The post presents switching to Alpine Linux as an engineering trade-off motivated by smaller container images and potentially improved startup times. It notes Alpine’s smaller ecosystem than Debian and cautions that claims about memory usage and performance should be tested with the application before production deployment.

## Approach / What changed

Replace Debian slim base images with Alpine images, change apt-get update and apt-get install to apk update and apk add, and review package-name differences between the distributions. Recent Bun, Node, and Rails Dockerfile generators support an --alpine option.

## Takeaways

- Measured Alpine base images were smaller than Debian slim equivalents: Bun 1.0.18 was 43.10MB versus 63.84MB, Node 21.4.0 was 46.83MB versus 70.08MB, Python 3.12.1 was 17.59MB versus 45.36MB, and Ruby 3.2 was 40.14MB versus 74.36MB.
- Alpine package names differ from Debian in several cases, such as build-essential versus build-base, libicu-dev versus icu-dev, and python versus python3; runtime packages may also differ from development packages.
- Alpine’s musl runtime can create compatibility issues for software tested on glibc, while some packages are unavailable, release candidates may be less tested, and precompiled Debian executables may not run on Alpine.

**Tags:** [Alpine Linux](https://yomu.fyi/topic/alpine-linux), [Docker](https://yomu.fyi/topic/docker)

- Source: [Fly.io](https://fly.io/blog/fly-with-alpine)
- Source URL: https://fly.io/blog/fly-with-alpine
- Ingested by Yomu: 2026-09-02T11:58:55.543Z

[Read original post](https://fly.io/blog/fly-with-alpine)
