• Stars
    star
    5,699
  • Rank 7,160 (Top 0.2 %)
  • Language
    Shell
  • License
    BSD 2-Clause "Sim...
  • Created almost 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Alpine Linux Docker image. Win at minimalism!

docker-alpine

CircleCI Docker Stars Docker Pulls Slack

A super small Docker image based on Alpine Linux. The image is only 5 MB and has access to a package repository that is much more complete than other BusyBox based images.

Why?

Docker images today are big. Usually much larger than they need to be. There are a lot of ways to make them smaller, but the Docker populace still jumps to the ubuntu base image for most projects. The size savings over ubuntu and other bases are huge:

REPOSITORY          TAG           IMAGE ID          VIRTUAL SIZE
gliderlabs/alpine   latest        9cfff538e583      4.803 MB
debian              latest        19134a8202e7      123.1 MB
ubuntu              latest        104bec311bcd      129 MB
centos              latest        67591570dd29      191.8 MB

There are images such as progrium/busybox which get us very close to a minimal container and package system. But these particular BusyBox builds piggyback on the OpenWRT package index which is often lacking and not tailored towards generic everyday applications. Alpine Linux has a much more complete and up to date package index:

$ docker run progrium/busybox opkg-install nodejs
Unknown package 'nodejs'.
Collected errors:
* opkg_install_cmd: Cannot install package nodejs.

$ docker run gliderlabs/alpine apk add --no-cache nodejs
fetch http://alpine.gliderlabs.com/alpine/v3.3/main/x86_64/APKINDEX.tar.gz
fetch http://alpine.gliderlabs.com/alpine/v3.3/community/x86_64/APKINDEX.tar.gz
(1/4) Installing libgcc (5.3.0-r0)
(2/4) Installing libstdc++ (5.3.0-r0)
(3/4) Installing libuv (1.7.5-r0)
(4/4) Installing nodejs (4.2.3-r0)
Executing busybox-1.24.1-r7.trigger
OK: 29 MiB in 15 packages

This makes Alpine Linux a great image base for utilities and even production applications. Read more about Alpine Linux here and you can see how their mantra fits in right at home with Docker images.

Usage

Stop doing this:

FROM ubuntu-debootstrap:14.04
RUN apt-get update -q \
  && DEBIAN_FRONTEND=noninteractive apt-get install -qy mysql-client \
  && apt-get clean \
  && rm -rf /var/lib/apt
ENTRYPOINT ["mysql"]

This took 19 seconds to build and yields a 164 MB image. Eww. Start doing this:

FROM gliderlabs/alpine:3.4
RUN apk add --no-cache mysql-client
ENTRYPOINT ["mysql"]

Only 3 seconds to build and results in a 36 MB image! Hooray!

Documentation

This image is well documented. Check out the documentation at Viewdocs and the docs directory in this repository.

Contacts

We make reasonable efforts to support our work and are always happy to chat. Join us in our Slack community or submit a GitHub issue if you have a security or other general question about this Docker image. Please email security or user mailing lists if you have concerns specific to Alpine Linux.

Inspiration

The motivation for this project and modifications to mkimage.sh are highly inspired by Eivind Uggedal (uggedal) and Luis Lavena (luislavena). They have made great strides in getting Alpine Linux running as a Docker container. Check out their mini-container/base image as well.

Sponsors

Fastly

Fastly provides the CDN for our Alpine Linux package repository. This allows super speedy package downloads from all over the globe!

License

The code in this repository, unless otherwise noted, is BSD licensed. See the LICENSE file in this repository.

More Repositories

1

registrator

Service registry bridge for Docker with pluggable adapters
Go
4,661
star
2

logspout

Log routing for Docker container logs
Go
4,645
star
3

ssh

Easy SSH servers in Golang
Go
3,634
star
4

herokuish

Utility for emulating Heroku build and runtime tasks in containers
Shell
1,434
star
5

docker-consul

Dockerized Consul
Shell
1,070
star
6

connectable

Magic proxy for internal services
Go
464
star
7

sigil

Standalone string interpolator and template processor
Go
413
star
8

resolvable

Host-level DNS gateway for Docker
Go
314
star
9

sshfront

Programmable SSH frontend
Go
301
star
10

com

Library for structuring Golang applications into components
Go
90
star
11

hostlocal

Host-level localhost for containers
69
star
12

hostctl

Opinionated CLI utility for easily provisioning cloud VMs
Go
35
star
13

stdcom

Re-usable Go components and micro-frameworks
Go
33
star
14

glidergun

Shell
31
star
15

cmd

Go
28
star
16

cellstack

DEPRECATED
Shell
23
star
17

pagebuilder

HTML
16
star
18

slack

JavaScript
15
star
19

comlab

Glider Labs app framework and development utility
Go
15
star
20

python-runtime

DEPRECATED
Shell
13
star
21

dockerbox

Container that runs a Docker daemon configured for running user code.
Go
13
star
22

infra.gl

DEPRECATED
HCL
12
star
23

kube-certdaemon

Simple daemon to fetch and refresh Let's Encrypt certs stored in k8s secrets
Go
7
star
24

glu

Glider Labs Utility, DEPRECATED
Go
7
star
25

gliderlabs.github.io

JavaScript
4
star
26

glidergun-rack

Shell
4
star
27

exp

Experimental projects and PoCs
Go
2
star
28

pkg

Go
2
star
29

ci

CI environment for Glider Labs projects
1
star
30

bigtoy

Glider Labs Semantic UI theme
1
star
31

gliderlabs.io

JavaScript
1
star
32

dns

HCL
1
star