For question related to installing packages on the Alpine Linux distribution via the Alpine Package Keeper — or apk.
Questions tagged [alpine-package-keeper]
49 questions
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
31
votes
3 answers
ERROR: unsatisfiable constraints using apk in dockerfile
I'm trying to install postgis into a postgres container.
Dockerfile:
FROM postgres:9.6.4-alpine
RUN apk update \
&& apk add -u postgresql-9.6-postgis-2.4 postgresql-9.6-postgis-2.4-scripts \
&& rm -rf /var/lib/apt/lists/*
COPY…

Slim
- 5,527
- 13
- 45
- 81
25
votes
1 answer
Does alpine `apk` have an ubuntu `apt` `--no-install-recommends` equivalent
I'm trying to make the absolute smallest Docker image I can get away with, so I have switched from ubuntu as my base to alpine.
For apt, I used to use --no-install-recommends to minimize "dependencies" installed with my desired packages. Is there an…

Zak
- 12,213
- 21
- 59
- 105
15
votes
1 answer
error: command 'gcc' failed with exit status 1 when installing pip packages on alpine docker image
I'm attempting transition my base docker image from centos 7 to alpine, however I receive gcc errors when trying to install pip packages.
This is a snippet of the error received:
Successfully built backports.ssl-match-hostname configobj dpkt…

solarflare
- 880
- 2
- 8
- 23
13
votes
3 answers
How to install terraform 0.12 in an alpine container with apk?
I want to add terraform version 0.12.21 in an alpine container, but I can only add 0.11.0 using apk. If I try to add it as the desired version I get the following error:
/ # apk upgrade terraform==0.12.21-r0
OK: 192 MiB in 66 packages
/ # apk add…

Alex Cohen
- 5,596
- 16
- 54
- 104
7
votes
3 answers
Dockerfile alpine image apk cannot find Java 8
I wanted to reduce my docker image and switched to an alpine base image instead. This lead to problems bash not finding apt. Turns out, I have to use apk instead. However, it does not seem to find the java version I need. Here is my dockerfile
#Use…

Essej
- 892
- 6
- 18
- 33
7
votes
0 answers
How to use binaries installed with `apk` `--force-broken-world` flag
I've been reading the man pages for apk add, but I don't fully understand how to use the --force-broken-world flag.
I was trying to install Python 2.7.6 into an Alpine image, but I got the following error.
$ docker run --rm -it alpine:latest apk add…

Zak
- 12,213
- 21
- 59
- 105
6
votes
2 answers
How to disable SSL verification in alpine's apk?
Is there any way to disable SSL verification at installing some packages?
I found how to add my certificate in trusted certificates, but I'd rather do disable this checking.
I need it to avoid following error:
SSL…

Sardorkhuja Tukhtakhodjaev
- 83
- 1
- 1
- 4
6
votes
4 answers
How can I install .apk file in alpine linux offline?
My docker image based on alpine Linex can not get anything from network. So the command "apk add xxx" is valid. Now my idea is downloading the .apk file and coping it into the docker container. But how can I install the .apk file ?

lai nan
- 61
- 1
- 1
- 4
5
votes
1 answer
How to install libvips on Alpine 3.8?
I try to install vips-dev package to alpine linux 3.8. But get following error:
docker run -it --rm alpine:3.8 /bin/sh -c "apk add --update --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing vips-dev"
fetch…

Molfar
- 1,411
- 3
- 18
- 49
5
votes
1 answer
Alpine Linux can't install lapack-dev on python:3.5-alpine3.4
I'm using docker python:3.5-alpine3.4 image and trying to install lapack-dev but it keeps failing. It is complaining that it can't find libgfortran.so.5. However, I've tried installing libgfortran and that does not seem to fix the problem.
(1/1)…

James
- 2,488
- 2
- 28
- 45
4
votes
1 answer
alpinelinux 3.12 missing man package?
I'm trying to get manpages working on alpinelinux 3.12, used latest 3.12 version and:
# apk add man
ERROR: unsatisfiable constraints:
man (missing):
required by: world[man]
Weird? apk add man-pages works perfectly. I've enabled all repos…

NoName13
- 166
- 9
3
votes
3 answers
unsatisfiable constraints error when installing pdftk alpine linux
When trying to install pdftk apk throws this error.
ERROR: unsatisfiable constraints:
pdftk (missing):
required by: world[pdftk]
Here is the whole output:
/opt/app # apk add pdftk
fetch…

ThreeAccents
- 1,822
- 2
- 13
- 24
2
votes
1 answer
Dockerfile alpine apk add using ARG to pin version fails
I have a docker file that as follows:
ARG ALPINE_VERSION=3.16.2
ARG GLAB_VERSION="1.22.0"
ARG JQ_VERSION="1.6"
FROM alpine:$ALPINE_VERSION
RUN apk add --no-cache "glab~=${GLAB_VERSION}" "jq~=${JQ_VERSION}"
ENTRYPOINT [ "glab" ]
When I try to…

rj93
- 523
- 8
- 25
2
votes
0 answers
How to use docker-abuild in a Dockerfile?
I want to use docker-abuild to build imagemagick in a Dockerfile. I use the following in the Dockerfile:
FROM alpinelinux/docker-abuild as imagickbuilder
COPY imagick/APKBUILD.imagick /home/builder/package/APKBUILD
COPY imagick/APKBUILD.imagick…

dockerman
- 21
- 2