• Stars
    star
    1,067
  • Rank 43,045 (Top 0.9 %)
  • Language
    Lua
  • License
    MIT License
  • Created over 5 years ago
  • Updated about 2 months ago

Reviews

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

Repository Details

Official Alpine Linux Docker image. Win at minimalism!

docker-alpine

alpine alpine

The official Docker image for Alpine Linux. The image is only 5MB and has access to a package repository that is much more featureful 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      CREATED      SIZE
alpine      latest  961769676411  4 weeks ago  5.58MB
ubuntu      latest  2ca708c1c9cc  2 days ago   64.2MB
debian      latest  c2c03a296d23  9 days ago   114MB
centos      latest  67fa590cfc1c  4 weeks ago  202MB

There are images such as progrium/busybox which get us 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 featureful 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 alpine apk add --no-cache nodejs
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
(1/7) Installing ca-certificates (20190108-r0)
(2/7) Installing c-ares (1.15.0-r0)
(3/7) Installing libgcc (8.3.0-r0)
(4/7) Installing http-parser (2.8.1-r0)
(5/7) Installing libstdc++ (8.3.0-r0)
(6/7) Installing libuv (1.23.2-r0)
(7/7) Installing nodejs (10.14.2-r0)
Executing busybox-1.29.3-r10.trigger
Executing ca-certificates-20190108-r0.trigger
OK: 31 MiB in 21 packages

This makes Alpine Linux a great image base for utilities, as well as production applications. Read more about Alpine Linux here and it will become obvious how its mantra fits in right at home with Docker images.

Note
All of the example outputs above were last generated/updated on May 3rd 2019.

Usage

Stop doing this:

FROM ubuntu:22.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 28 seconds to build and yields a 169 MB image. Start doing this:

FROM alpine:3.16
RUN apk add --no-cache mysql-client
ENTRYPOINT ["mysql"]

Only 4 seconds to build and results in a 41 MB image!

More Repositories

1

aports

[MIRROR] Alpine packages build scripts
Shell
634
star
2

alpine-make-vm-image

Make customized Alpine Linux disk image for virtual machines
Shell
293
star
3

alpine-chroot-install

Install Alpine Linux in chroot with a breeze. Build ARM on Travis CI or any other x86_64 CI.
Shell
285
star
4

alpine-make-rootfs

Make customized Alpine Linux rootfs (base image) for containers
Shell
178
star
5

apk-tools

[MIRROR] Alpine package manager
C
164
star
6

alpine-conf

[MIRROR] Alpine configuration management scripts
Shell
67
star
7

abuild

[MIRROR] Build script to build Alpine packages
Shell
59
star
8

mkinitfs

[MIRROR] Tool to create initramfs images
Shell
54
star
9

awall

[MIRROR] Alpine firewall configuration tool
Lua
46
star
10

alpine-secdb

[MIRROR] Alpine Linux security database
Lua
40
star
11

aports-turbo

[MIRROR] Alpine Linux package database
Lua
24
star
12

docker-abuild

WARNING This project has moved to Alpine Linux GitLab instance
Shell
19
star
13

linux-stable-grsec

grsecurity backports for linux-stable branches
C
17
star
14

alpine-iso

Alpine ISO image generation scripts (mirror)
Makefile
16
star
15

alpine-docker-gitlab

[MIRROR] Gitlab docker image based on Alpine Linux
Shell
14
star
16

turbo-paste

[MIRROR] Turbo paste
Lua
13
star
17

alpine-netboot

Alpine netboot (mirror)
CSS
9
star
18

ca-certificates

Mirror of git://git.alpinelinux.org/ca-certificates
Perl
9
star
19

alpine-wiki

Alpine Linux wiki
HTML
8
star
20

alpine-backup

Alpine Remote Backup (mirror)
Shell
6
star
21

alpine-baselayout

[MIRROR] Alpine boot scripts
Makefile
6
star
22

lua-aports

[MIRROR] Aports tools written in Lua
Lua
6
star
23

dmvpn-tools

[MIRROR] Userland tools to setup and manage DMVPN
Shell
4
star
24

alpine-mksite

[MIRROR] Website for alpinelinux.org
CSS
3
star
25

alpine-drone-ci

Build Alpine Linux packages with drone CI
Shell
2
star
26

alpine-mirror-status

[MIRROR] Scripts to generate Alpine mirror statistics
Lua
2
star
27

alpine_bootstrap

Alpine Linux bootstrap theme for drupal
CSS
1
star
28

build-server-status

[MIRROR] Web page for Alpine Linux build servers
Go
1
star