Deploy your own Alpine Linux packages repository with uploading server and auto indexing!
latest,indexer-0.1,indexerhttpd-0.1,0.1
inderxer- Only theindexer, description below in Indexerhttpd- Both the indexer and httpd to server the repository
This images contain only the indexer services, which listening on these endpoints:
POST /upload- upload a single alpine package and rebuild indexPOST /bulk_upload- upload multiple alpine packages and rebuild indexPOST /build- rebuild index
Usage examples:
Run the indexer:
docker run -p 80:80 -p /path/to/repo/x86_64:/repo avivabramovich/alpine-repository:indexer
And serve the repository files (in this example, using httpd):
docker run -p 8080:80 -v /path/to/repo:/usr/local/apache2/htdocs/:ro httpd
Now, upload some packages to your repo
apk fetch -R bash
# fetched 6 packages
# upload a single package
curl -X POST -F "file=@bash-5.1.0-r0.apk http://your_repo/upload"
# use bulk_upload to upload all packages in directory
curl -X POST $(for f in *.apk; do echo -F "file=@$f"; done) http://your_repo/bulk_uploadNow, configure your alpine machine/container to use your new repository
echo http://your_repo > /etc/apk/repositories
# add --allow-untrusted if you don't use the trusted options in the indexer
apk update
# add --allow-untrusted if you don't use the trusted options in the indexer
apk add bashREPOISOTRY_PATH- path inside the container to repository (include the architecture), e.g./repo/x86_64. default:/repoPRIV_KEY_PATH- path to private key file. Add this option to sign theAPKINDEX.tar.gzthe indexer crates and make the repository trusted.CLEAN_ON_STRARTUP- Set toTRUEto remove all files from repository directory when starting theindexer. Mainly for debugging.MAX_CONTENT_LENGTH- the maximum file content size of upcoming requests for the indexer.INDEXER_PORT- a port which the indexer app listens on. default: 80 in onlyindexervariant, 5000 inindexer + httpd
version: '3.8'
services:
indexer:
image: avivabramovich/alpine-repository:indexer
ports:
- '8080:80'
volumes:
- '/path/to/repo/x86_64:/repo'
repo-httpd:
image: httpd:2.4-alpine
ports:
- '80:80'
volumes:
- '/path/to/repo:/usr/local/apache2/htdocs/:ro'version: '3.8'
services:
indexer:
image: avivabramovich/alpine-repository:indexer
ports:
- '8080:80'
volumes:
- '/path/to/repo/x86_64:/repo'
- '/path/to/keys@your.email@gmail.com.rsa:/mnt/keys@your.email@gmail.com.rsa'
environment:
- PRIV_KEY_PATH=/mnt/keys@your.email@gmail.com.rsa
repo-httpd:
image: httpd:2.4-alpine
ports:
- '80:80'
volumes:
- '/path/to/repo:/usr/local/apache2/htdocs/:ro'