Questions tagged [alpine-linux]

Alpine Linux is a small, simple and secure Linux distribution based on musl libc and busybox. For questions related to the Alpine.js framework, use the tag [alpine.js].

The Alpine Linux distribution is born from a fork of another Linux project called LEAF (Linux Embedded Appliance Framework Project) that was itself forked from a project aimed at keeping a Linux distribution fitting on a floppy disk.

With its light-weighted approach, Alpine is very popular for embedded systems and containers alike, as it also offers quick boot-up time. A container running Alpine would take no more than 8 MB; while an installation on a disk would require around 130 MB.

This small size is also achieved with simplicity in mind. Alpine uses its own package manager, called apk and is coming with a really limited set of tools:

  • musl, for a minimal libc
  • openrc, as the init system
  • the coreutils of busybox

Alpine is making use of techniques like Position Independent Executables (PIE) and stack smashing protection, which protects the OS from some common vulnerabilities.

Resources

Related tags

1772 questions
425
votes
7 answers

Docker: How to use bash with an Alpine based docker image?

I created a docker image from openjdk:8-jdk-alpine and I want to use bash, rather than sh as my shell, however when I try to execute simple commands I get the following errors: RUN bash /bin/sh: bash: not found RUN ./gradlew build env: can't…
iamdeit
  • 5,485
  • 4
  • 26
  • 40
259
votes
3 answers

How do I add a user when I'm using Alpine as a base image?

I'm using alpine (or an image that is based on Alpine) as the base image in my Dockerfile. Which instructions do I need to add to create a user? Eventually I'll use this user to run the application I'll place into the container so that the root…
Daniel Gartmann
  • 11,678
  • 12
  • 45
  • 60
245
votes
4 answers

Starting a shell in the Docker Alpine container

To start an interactive shell for the Ubuntu image we can run: ole@T:~$ docker run -it --rm ubuntu root@1a6721e1fb64:/# ls bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var But when this is run…
Ole
  • 41,793
  • 59
  • 191
  • 359
210
votes
2 answers

What is .build-deps for apk add --virtual command?

What is .build-deps in the following command? I can't find an explanation in the Alpine docs. Is this a file that is predefined? Is see this referenced in many Dockerfiles. RUN apk add --no-cache --virtual .build-deps \ gcc \ freetype-dev…
gdbj
  • 16,102
  • 5
  • 35
  • 47
201
votes
4 answers

Why is the Java 11 base Docker image so large? (openjdk:11-jre-slim)

Java 11 is announced to be the most recent LTS version. So, we're trying to start new services based on this Java version. However, the base Docker image for Java 11 is much larger than the equivalent for Java 8: openjdk:8-jre-alpine: 84…
radistao
  • 14,889
  • 11
  • 66
  • 92
193
votes
6 answers

No such file or directory "limits.h" when installing Pillow on Alpine Linux

I'm running alpine-linux on a Raspberry Pi 2. I'm trying to install Pillow via this command: pip install pillow This is the output from the command: Installing collected packages: pillow Running setup.py install for pillow Complete output from…
uberma
  • 1,933
  • 2
  • 10
  • 7
189
votes
2 answers

Alpine Dockerfile advantages of --no-cache vs. rm /var/cache/apk/*

When creating Dockerfiles using an Alpine image, I have often seen the use of either apk add --no-cache, or apk add followed by an rm /var/cache/apk/* statement. I am curious to know whether making use of the --no-cache flag eliminates the need to…
Angel S. Moreno
  • 3,469
  • 3
  • 29
  • 40
169
votes
12 answers

Why does it take ages to install Pandas on Alpine Linux

I've noticed that installing Pandas and Numpy (it's dependency) in a Docker container using the base OS Alpine vs. CentOS or Debian takes much longer. I created a little test below to demonstrate the time difference. Aside from the few seconds…
moku
  • 4,099
  • 5
  • 30
  • 52
155
votes
2 answers

In Docker image names what is the difference between Alpine, Jessie, Stretch, and Buster?

I am just looking at docker images in https://hub.docker.com/_/node/ For every version, the images are categorized into Alpine, Jessie, Stretch, Buster etc. What's their meaning?
Muthukumar
  • 8,679
  • 17
  • 61
  • 86
150
votes
8 answers

How do I install python on alpine linux?

How do I install python3 and python3-pip on an alpine based image (without using a python image)? $ apk add --update python3.8 python3-pip ERROR: unsatisfiable constraints: python3-pip (missing): required by: world[python3-pip] …
Cutaraca
  • 2,069
  • 3
  • 14
  • 21
120
votes
1 answer

Install packages in Alpine docker

How do I write Dockerfile commands to install the following in alpine docker image: software-properties-common openjdk-8-jdk python3 nltk Flask
Ankur100
  • 1,209
  • 2
  • 8
  • 7
115
votes
5 answers

Error: pg_config executable not found when installing psycopg2 on Alpine in Docker

I'm trying to build a Flask app using Postgres with Docker. I'd like to connect to an AWS RDS instance of Postgres, but use Docker for my Flask app. However, when trying to set up psycopg2 it runs into an error because it can't find pg_config.…
dace
  • 5,819
  • 13
  • 44
  • 74
115
votes
13 answers

"The headers or library files could not be found for jpeg" installing Pillow on Alpine Linux

I'm trying to run Python's Scrapy in a Docker container based on python:alpine. It was working before, but now I'd like to use Scrapy's Image Pipeline which requires me to install Pillow. As a simplified example, I tried the following…
Kurt Peek
  • 52,165
  • 91
  • 301
  • 526
107
votes
7 answers

Go-compiled binary won't run in an alpine docker container on Ubuntu host

Given a binary, compiled with Go using GOOS=linux and GOARCH=amd64, deployed to a docker container based on alpine:3.3, the binary will not run if the docker engine host is Ubuntu (15.10): sh: /bin/artisan: not found This same binary (compiled for…
Oleg Sklyar
  • 9,834
  • 6
  • 39
  • 62
104
votes
7 answers

Docker: any way to list open sockets inside a running docker container?

I would like to execute netstat inside a running docker container to see open TCP sockets and their statuses. But, on some of my docker containers, netstat is not available. Is there any way to get open sockets (and their statuses, and which IP…
AdvilUser
  • 3,142
  • 3
  • 25
  • 15
1
2 3
99 100