[SOLVED] Package mentioned in index not found (try 'apk update')
-
- Offline
- 2 years 3 months ago
- 2015-12-04
I am using Alpine Linux with docker and my idea is to
build a local repository under an Apache web server reducing bandwith & delays.
So far so good, I created a docker image with an external
volume called cache under /vol/cache.
This is internal linked to a docker directory named /etc/apk/cache
After running the docker container I enter the shell making a cache update after
installation with
"apk update -vU --allow-untrusted"
Resulting in populating the directory with all the installed packages as apk files.
alpine-base-3.2.3-r0.6210c243.apk alpine-baselayout-2.3.2-r0.f9c0e2cc.apk alpine-conf-3.2.1-r6.571324ae.apk alpine-keys-1.1-r0.0403eb8d.apk ...
Then I made an APKINDEX.tar.gz with
apk index -vU --allow-untrusted -o /etc/apk/cache/APKINDEX.tar.gz /etc/apk/cache/*.apk
Here the final result:
alpine-base-3.2.3-r0.6210c243.apk alpine-baselayout-2.3.2-r0.f9c0e2cc.apk alpine-conf-3.2.1-r6.571324ae.apk alpine-keys-1.1-r0.0403eb8d.apk APKINDEX.tar.gz ...
I linked the volume called cache to an EXTERNAL to docker apache subdirectory named x86_64 with
(Next step would be an internal mini_httpd with localhost link)
"ln -s /vol/cache /var/www/html/cache/x86_64"
Here how it looks like:
/var/www/html |-- cache | `-- x86_64 -> /vol/cache |-- icons -> /usr/share/apache2/icons/ `-- index.html
Next I changed the /etc/apk/repositories adding one line
"http://172.17.0.1/cache"
My dockerfile contains at some place
"... apk add -U --allow-untrusted --repository "http://172.17.0.1/cache" ..."
The result is
fetch "http://172.17.0.1/cache/x86_64/APKINDEX.tar.gz" (1/10) Installing ncurses-terminfo-base (6.0-r2) ERROR: ncurses-terminfo-base-6.0-r2: package mentioned in index not found (try 'apk update' ...
Apparently I am doing something wrong, the documentation how to build a local
apk repository is thin or not available.
Can someone enlight me how to accomplish this?
TIA
giminni
I found myself the solution:
downloaded file in a cache directory has alway x.y.z
for x=filename&ver, y=unique_key and z=.apk suffix
using the same directory for downloaded files from mainstream an own repo file there is a difference
own repo must have only x.z and therefore i made a one liner to remove y (unique key) and make a
relative symlink to the downloaded files. This guarantees the external access via web browser and the
internal access from a docker container :-)
Looking now
Resulting in
Apache is happy logging:
At the end rebuilding a docker container is very fast using a local persistent docker data volume.
Another benefit is the possibility to add packages from the container itself.