Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package missing in Alpine Linux even though it's listed on package repo website [closed]

I am attempting to build out a Docker container that runs Alpine Linux with GDAL and the necessary Python hooks:

FROM python:3.6-alpine

RUN apk update

RUN apk add py-gdal gdal

RUN pip install uwsgi

RUN mkdir /code
WORKDIR /code
COPY requirements.txt .

RUN pip install -r requirements.txt

COPY . .

CMD ["uwsgi", "--ini", "uwsgi.ini"]

As you can see, I'm running both an apk update statement to update repos, and then apk add statements to install the packages. Here is the output I receive:

/usr/bin/make -f /Users/some_guy/Workspace/tagging_tracker_backend/Makefile build up
Pulling nginx ... 
Pulling db    ... 
Pulling web   ... 
db uses an image, skipping
Building nginx
Step 1/3 : FROM nginx:1.15
 ---> 7042885a156a
Step 2/3 : RUN rm /etc/nginx/conf.d/default.conf
 ---> Using cache
 ---> 97782a5dae3a
Step 3/3 : COPY nginx.conf /etc/nginx/conf.d/tag.conf
 ---> Using cache
 ---> 3158ab7993cd
Successfully built 3158ab7993cd
Building web
Successfully tagged tagging_tracker_backend_nginx:latest
Step 1/10 : FROM python:3.6-alpine
 ---> de35df1f34dd
Step 2/10 : RUN apk update
 ---> Using cache
 ---> 15477d802b32
Step 3/10 : RUN apk add py-gdal gdal
 ---> Running in 77bef31e5d15
ERROR: unsatisfiable constraints:
  gdal (missing):
    required by: world[gdal]
  py-gdal (missing):
    required by: world[py-gdal]
Service 'web' failed to build: The command '/bin/sh -c apk add py-gdal gdal' returned a non-zero code: 2
make: *** [build] Error 1

Process finished with exit code 2

Both of these packages can be found at the Alpine Linux package website.

I'm not familiar with Alpine Linux but am used to installing packages on other types of Linux. Is there another command that needs to be passed in here?

like image 900
nerdenator Avatar asked Feb 05 '19 01:02

nerdenator


1 Answers

The gdal package you linked to is in the edge-testing repository, not one of the release branches. To install it, you'd have to specifically specify that repository. gdal also has dependencies on packages in edge-main, so you need to include that, too.

apk add \
  --no-cache \
  --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
  --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
  gdal
like image 125
King Chung Huang Avatar answered Oct 14 '22 02:10

King Chung Huang