问题
I am trying to create a docker image based on alpine:3.7, but I get errors while installing some packages with apk add.
Example:
ERROR: unsatisfiable constraints:
apache2-suexec (missing):
required by: world[apache2-suexec-custom]
host (missing):
required by: world[host]
lpr (missing):
required by: world[lpr]
time (missing):
required by: world[time]
The cause is that these packages do not exist in alpine repositories yet. How can I solve these issues? Is there any repository from which I can download them?
I'm using this line
FROM alpine:3.7
RUN apk update \
&& apk upgrade \
&& apk --no-cache add --update tcl apache2 apache2-suexec ca-certificates \
apk-tools curl build-base supervisor lpr time dcron host rsync libxml2-utils libxslt
回答1:
You have an issue with the following packages: apache2-suexec, host, lpr and time.
Alpine has some other package structure than main Linux OSs:
apache2-suexecis a part ofapache2package;hostis a part ofbind-toolspackage;lpris a part ofcups-clientpackage;timeis already in alpine image. It usesbusybox'stimeutility.
So, the final Dockerfile is:
FROM alpine:3.7
RUN apk update \
&& apk upgrade \
&& apk --no-cache add --update tcl apache2 ca-certificates \
apk-tools curl build-base supervisor cups-client dcron bind-tools rsync libxml2-utils libxslt
来源:https://stackoverflow.com/questions/48869833/alpine-unsatisfiable-constraints-missing-packages