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].

Filter by
Sorted by
Tagged with
446 votes
8 answers
417k views

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: ...
iamdeit's user avatar
  • 5,765
278 votes
4 answers
286k views

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 ...
Daniel Gartmann's user avatar
254 votes
4 answers
295k views

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 ...
Ole's user avatar
  • 44.4k
220 votes
2 answers
91k views

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 -...
gdbj's user avatar
  • 16.9k
212 votes
2 answers
140k views

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 ...
Angel S. Moreno's user avatar
203 votes
4 answers
164k views

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 ...
radistao's user avatar
  • 15.2k
195 votes
7 answers
128k views

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 ...
uberma's user avatar
  • 1,953
185 votes
2 answers
93k views

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's user avatar
  • 9,189
170 votes
12 answers
118k views

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 ...
moku's user avatar
  • 4,149
167 votes
10 answers
310k views

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): ...
Cutaraca's user avatar
  • 2,279
129 votes
1 answer
163k views

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's user avatar
  • 1,299
120 votes
13 answers
122k views

"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 ...
Kurt Peek's user avatar
  • 54.7k
119 votes
7 answers
126k views

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 ...
AdvilUser's user avatar
  • 3,382
119 votes
6 answers
105k views

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 ...
dace's user avatar
  • 6,071
108 votes
7 answers
62k views

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/...
Oleg Sklyar's user avatar
  • 9,954
104 votes
3 answers
171k views

How to install OpenSSH on Alpine?

When running an alpine docker container for the first time and attempting to install openssh, I get the following error: ole@T:~$ docker run -it --rm alpine /bin/ash / # apk add openssh WARNING: ...
Ole's user avatar
  • 44.4k
103 votes
16 answers
144k views

How to install aws-cli on alpine?

I'm installing aws-cli on a docker swarm manager node running alpine (Linux 0317632a4ad9 4.9.59-moby #1 SMP Thu Mar 1 20:54:00 UTC 2018 x86_64 Linux). The aws-cli package for Alpine is currently ...
HieroB's user avatar
  • 4,087
102 votes
8 answers
143k views

Alpine Docker ERROR: Unable to lock database: Permission denied ERROR: Failed to open apk database: Permission denied

So I have used the default docker for testcafe which on docker hub is testcafe/testcafe and I have to run a few testcafe scripts. However, I need the screenshot that fires on error, to be uploaded ...
Vladimir_314159's user avatar
94 votes
5 answers
88k views

Java 11 application as lightweight docker image

Inspired by question Why is the Java 11 base Docker image so large? (openjdk:11-jre-slim) I found that this topic in Java world is still not settled. As for 07 Dec 2018 there are common issues/...
radistao's user avatar
  • 15.2k
86 votes
3 answers
70k views

Alpine Add Package from Edge repository

If I'm using Alpine 3.8, how can I add a specific package from the Alpine Edge repository? Is this even supported? There is no equivalent of backports, from what I can see. I want to add the new ...
clay's user avatar
  • 19.3k
82 votes
7 answers
114k views

Is there a best practice on setting up glibc on docker alpine linux base image?

Is there a best practice on setting up glibc on docker alpine linux base image with correct paths so any spawned process can correctly reference the location of the installed libc libraries?
kai's user avatar
  • 867
81 votes
1 answer
42k views

GCC can't find stdio.h in Alpine Linux

In a fresh Alpine Linux I installed GCC by apk add --update-cache gcc but still a simple program #include <stdio.h> int main(int argc, char *argv[]) { return 0; } compiled with message ...
Franklin Yu's user avatar
  • 9,512
79 votes
8 answers
99k views

Docker Node Alpine Image Build Fails on node-gyp

I'm attempting to Dockerize a Vue.js application. I'm using the node:10.15-alpine Docker image as a base. The image build fails with the following error: gyp ERR! configure error gyp ERR! stack Error:...
Jason's user avatar
  • 2,620
78 votes
4 answers
129k views

How do I run a Bash script in an Alpine Docker container?

I have a directory containing only two files, Dockerfile and sayhello.sh: . ├── Dockerfile └── sayhello.sh The Dockerfile reads FROM alpine COPY sayhello.sh sayhello.sh CMD ["sayhello.sh"] ...
Kurt Peek's user avatar
  • 54.7k
77 votes
10 answers
105k views

alpine package py-pip missing

Im trying to install python pip in my alpine using Docker compose file but get the following error. ERROR: unsatisfiable constraints: py-pip (missing): required by: world[py-pip] ERROR: Service ...
user1050619's user avatar
  • 20.4k
76 votes
6 answers
95k views

Docker Alpine executable binary not found even if in PATH

I have an alpine running container which contains some binaries in usr/local/bin When I ls the content of usr/local/bin I got this output : /usr/local/bin # ls dwg2SVG dwg2dxf dwgadd ...
jossefaz's user avatar
  • 3,714
76 votes
3 answers
153k views

How to add trusted root CA to Docker alpine

Suppose I am at network where there is MITM SSL swaping firewall (google.com is not issued by Google, but reissued by custom CA root authority) some more details here https://security.stackexchange....
bedla.czech's user avatar
  • 1,069
69 votes
7 answers
53k views

Installed Go binary not found in path on Alpine Linux Docker

I've got a Go binary I'm trying to run on the Alpine Docker image. This works fine for the Docker Go binary. docker run -it alpine:3.3 sh apk add --no-cache curl DOCKER_BUCKET=get.docker.com ...
Everett Toews's user avatar
64 votes
5 answers
81k views

Docker Alpine Linux python (missing)

I have a pipeline which deploys my container from GitLab. Last deployment was 5 days ago and went without any problems. Today I deploy it and get the following error: $ apk add --no-cache curl python ...
AGoranov's user avatar
  • 2,214
62 votes
4 answers
63k views

How to get /etc/profile to run automatically in Alpine / Docker

How can I get /etc/profile to run automatically when starting an Alpine Docker container interactively? I have added some aliases to an aliases.sh file and placed it in /etc/profile.d, but when I ...
Jeff Kilbride's user avatar
59 votes
1 answer
189k views

Getting apt-get on an alpine container

I have to install a few dependencies on my docker container, I want to use python:3.6-alpine version to have it as light as possible, but apk package manager which comes with alpine is giving me ...
NotSoShabby's user avatar
  • 3,510
58 votes
10 answers
84k views

Installing numpy on Docker Alpine

I'm trying to install numpy in a docker container based on Alpine 3.1. I'm using the following Dockerfile: FROM alpine:3.1 RUN apk add --update make cmake gcc g++ gfortran RUN apk add --update python ...
TDN169's user avatar
  • 1,417
57 votes
9 answers
118k views

How to install Go in alpine linux

I am trying to install Go inside an Alpine Docker image. For that I downloaded tar file from here inside my alpine docker image, untar it using following command: tar -C /usr/local -xzf go1.10.3....
Yogesh Jilhawar's user avatar
56 votes
12 answers
110k views

docker can't build because of alpine error

Hi I am trying build a docker and Docker file looks like this. FROM alpine LABEL description "Nginx + uWSGI + Flask based on Alpine Linux and managed by Supervisord" # Copy python requirements file ...
BhanuKiran's user avatar
  • 2,891
50 votes
5 answers
49k views

Cannot "pip install cryptography" in Docker Alpine Linux 3.3 with OpenSSL 1.0.2g and Python 2.7

Solved Wow, these guys are fast... It's basically this https://github.com/pyca/cryptography/issues/2750 It turned out that a security update for openssl was released (DROWN Attack) and that update ...
Daniel F's user avatar
  • 14k
42 votes
1 answer
44k views

Docker alpine image's basic commands are not working

docker started to produce weird bugs when I was using a few simple alpine based containers. Two of these problems are: rc-update was not found when i was trying to use it after installing openssh ...
SLOBY's user avatar
  • 1,047
42 votes
16 answers
105k views

UnrecognizedClientException error when authenticating on aws-cli

When I pull a clean Alphine Linux Docker image, install aws-cli on it and try to authenticate myself with aws ecr get-authorization-token --region eu-central-1 I keep getting the following error: ...
cute_marmalade's user avatar
39 votes
6 answers
46k views

How do I install XDebug on docker's official php-fpm-alpine image?

I'm using wordpress:php7.1-fpm-alpine which is based on php:7.1-fpm-alpine (https://github.com/docker-library/wordpress/blob/master/php7.1/fpm-alpine/Dockerfile). I've tried RUN pecl install xdebug-2....
Chris Stryczynski's user avatar
37 votes
10 answers
156k views

How to solve "Could not find any Python installation to use" with docker node alpine Image when adding bcrypt to package.json?

Before I added bcrypt to my package.json, everything was working fine. Now, I get the error message below. This is an excerpt of my package.json: "dependencies": { "bcrypt": "3.0.6", "...
Jens's user avatar
  • 821
36 votes
4 answers
23k views

Does Alpine have known DNS issue within Kubernetes?

Lately, we've faced some DNS issues with micro-services based on Alpine image (node:12.18.1-alpine) on EKS when trying to resolve "big" DNS queries (When the answer is larger than 512M). So ...
Shahaf Yehezkel's user avatar
36 votes
2 answers
80k views

Where to set system default environment variables in Alpine linux?

I know, with Ubuntu, you can set default values for environment variables in /etc/environment; I do not see that file in Alpine linux. Is there a different location for setting system-wide defaults?
1ijk's user avatar
  • 1,477
34 votes
2 answers
39k views

Explanation of the "--update add" command for Alpine Linux

I'm trying to understand the Dockerfile https://hub.docker.com/r/rdsubhas/tor-privoxy-alpine/~/dockerfile/, which contains a RUN executive with apk --update add privoxy tor@testing runit@testing I ...
Kurt Peek's user avatar
  • 54.7k
34 votes
6 answers
125k views

unable to add certificates to alpine linux container

I have a small python app inside an alpine linux container, here is the dockerfile: FROM alpine # basic flask environment RUN apk add --no-cache bash git nginx uwsgi uwsgi-python py2-pip \ &&...
Gil Zellner's user avatar
32 votes
8 answers
35k views

psycopg2 installation for python:2.7-alpine in Docker

To use PostgreSql in python I need to pip install psycopg2 However, it has dependency on libpq-dev and python-dev. I wonder how can I install the dependencies in alpine? Thanks. Here is a ...
salehinejad's user avatar
  • 7,338
32 votes
4 answers
48k views

docker alpine /bin/sh script.sh not found

I'm trying to build a docker image that has the openjdk:8-alpine as base. The problem is when I try to execute a script.sh, returning me the following message: /bin/sh: bin/script.sh: not found ...
Thiago G. Alves's user avatar
32 votes
1 answer
55k views

How can we install google-chrome-stable on alpine image in dockerfile using dpkg?

I am trying to install google-chrome-stable on alpine image using dpkg. However, the dpkg is installed but it does not install google-chrome-stable and return this error instead? Is there a way to ...
Code father's user avatar
31 votes
2 answers
63k views

How can I install Docker inside an alpine container?

How can I install Docker inside an alpine container and run docker images? I could install, but could not start docker and while running get "docker command not found error".
Subit Das's user avatar
  • 539
31 votes
3 answers
24k views

Installing ssh-keyscan on Alpine linux?

In order to successfully clone a private repository into an Alpine-based docker, I needed to run the following command: ssh-keyscan github.com >> ~/.ssh/known_hosts. But since ssh-keyscan isn'...
FuzzyAmi's user avatar
  • 7,923
31 votes
3 answers
22k views

Docker: Are node alpine images at the end smaller than full node images?

I'm running a cluster of nodeJS applications - which should be very small as they are run as microservices. Only a few of them need extra things like bcrypt or imagemagick - which makes some trouble ...
user3142695's user avatar
  • 16.7k
31 votes
2 answers
18k views

What is the difference between alpine docker image and busybox docker image?

What is the difference between alpine docker image and busybox docker image ? When I check their dockfiles, alpine is like this (for Alpine v3.12 - 3.12.7) FROM scratch ADD alpine-minirootfs-3.12.7-...
Qiulang's user avatar
  • 11.4k

1
2 3 4 5
37