Migrating Dockerfiles from Debian apt to Alpine apk

Grigor Khachatryan
devgorilla
Published in
1 min readMar 28, 2019

Purpose

This is a guide to migrate Debian’s apt package management commands to Alpine’s apk commands.

Software packages for Alpine Linux are digitally signed tar.gz archives that contain binaries, configuration files and dependency metadata. Packages, sometimes called “a-packs” use the extension .apk.

How to use this guide

Use this guide to translate Debian apt-get commands to Alpine apk commands used within a Dockerfile.

Because this guide focuses on Dockerfiles, it only covers a selected subset of all apk commands. Readers interested in learning more about apk should read Alpine’s package management guide.

The following table contains the mapping from apt commands to apk commands.

Learning more about apk

The fastest to learn about apk is to use it within a Docker container.

$ docker pull alpine$ docker run -ti alpine

You will get Alpine’s shell prompt. To get detailed information on options and sub-commands, execute:

#apk --help --verbose

Like to learn?

Follow me on twitter where I post all about the latest and greatest AI, DevOps, VR/AR, Technology, and Science! Connect with me on LinkedIn too!

--

--