Demonstrates building a .deb packages repository
For help with installing Debian packages README.md
TODO:
- Look at adequate - https://manpages.debian.org/testing/adequate/adequate.1.en.html
Build the image to build the packages and index
docker build -t debianbuilder -f build.Dockerfile .
Build the debian package in Docker
mkdir packages
docker run -it -v=$(pwd):/packages debianbuilder --action=build -p=hello-world -o=./packages/
docker run -it -v=$(pwd):/packages debianbuilder --action=package -p=packages
# Add --debug to it if you want to check paths in index
docker run -it -v=$(pwd):/packages debianbuilder --action=package -p=packages --debug
Host the repository
docker build -f hostpackages.Dockerfile -t hostpackages .
docker run --name hostpackages --rm -d -p 8080:80 hostpackages
open http://localhost:8080
curl localhost:8080
curl localhost:8080/debian/packages/hello-world_1.0_all.deb
curl localhost:8080/debian/Packages.gz
Install the package into a Docker container
docker build --build-arg=REPOSITORY_URL=http://0.0.0.0:8080/debian --network="host" -t usepackages --no-cache -f usepackages.Dockerfile .
docker stop hostpackages
Install the package from the repository locally
echo "deb [trusted=yes] http://localhost:8080/debian ./" | sudo tee -a /etc/apt/sources.list > /dev/null
sudo apt-get update
sudo apt-get install hello-world
which hello-world.sh
hello-world.sh
sudo apt-get remove hello-world
sudo add-apt-repository -r "deb [trusted=yes] http://localhost:8080/debian ./"
cat /etc/apt/sources.list
docker stop aptrep
Get access inside the container.
# Debug deb build or packaging
docker run -it -v=$(pwd):/packages --entrypoint /bin/bash debianbuilder
# Debug repository
docker run --name hostpackages --rm -it --entrypoint=/bin/bash hostpackages
# Debug use package
docker run -it --entrypoint /bin/bash usepackages
# Base
docker run -it --entrypoint=/bin/bash ubuntu:16.04