Since I was documenting what I was doing to debug errors, here's a short how-to for people who want to use the docker-registry app with authentication to build their own apps. Before submitting I realized that @girish already made a post here, but that was without the registry so I'm posting it either way
Prerequisites:
A machine that has both, docker and the cloudron cli installed and of course one or two Cloudrons for the apps to build and/or install
Docker: https://docs.docker.com/engine/install/ubuntu/
Cloudron CLI: https://docs.cloudron.io/custom-apps/cli/
How to build apps and push to your Docker-Registry
install the docker-registry app on a cloudron (if possible don't use a production server), e.g. docker.example.com (you might want to create a dedicated user to work with it). Add the URL and docker credentials to your target cloudron in Settings / Private Docker Registry
Optional: use the Cloudron Build Service
install the Build Service app, e.g. https://build.example.com, open the terminal or file manager of the app and enter your docker credentials in
/app/data/docker.json
. After those changes reboot the build service app to make sure the correct registry is in there. You can directly login to your build service (no trailing slash in the url! see https://docs.cloudron.io/apps/build-service/ for more information) via
$cloudron build --set-build-service
(enter https://build.example.com)
clone any repo you want to build
$git clone https://git.cloudron.io/cloudron/lamp-app
cwd into the cloned git directory
$cd lamp-app/
With local build
login to the docker-registry with your credentials (as non root user you might need to use sudo when issuing docker commands)
$docker login docker.example.com
build the thing (use custom lamp-app:tags if you want specific tag names)
$docker build -t docker.example.com/lamp-app .
push to the registry - this does not work without logging in first
$docker push docker.example.com/lamp-app
install on your target cloudron after logging in via
cloudron login
$cloudron install --image docker.example.com/lamp-app
With the Build Service
If you're using the build service, you can just run
$cloudron build
and enter your docker-repo (e.g.docker.example.com/lamp-app
)
and after logging in to your cloudron
$cloudron install --image docker.example.com/lamp-app
If you updated an app, you can use cloudron update
to push a new version for an existing app.
Cheers, M