Is there any way to build cloudron apps without publishing the app to docker hub?
-
Earlier in the packaging tutorial it has steps to login to cloudron via the cli using
cloudron login my.example.com
but it doesn't have a sept to login to docker before trying to rundocker build
.At least one missing step I think that is needed to help get towards a solution is doing a docker login to the private docker registry hosted on cloudron by doing the following:
docker login https://dockerregistry.cloudron.ourdomain.com
and then login with your cloudron credentials.
-
To fix the docker build command drop the
https://
off of the tag name which turns it into:docker build -t dockerregistry.cloudron.ourdomain.com/cloudronusername/appname:v1 .
From this it seems like docker using the format of a tag name to defined the remote repository where a image should be pushed to, I feel like that isn't right as that seems like a bad idea.
Now when doing docker push change it to:
docker push dockerregistry.cloudron.ourdomain.com/cloudronusername/appname:v1
This isn't using the cloudron build server but at least this seems to work to get the image pushed to the cloudron hosted docker registry.
-
This post is deleted!
-
I'm not understanding the problem.
Certainly nohttps
needed in the docker build statement
The docker push goes to your own private registry -
To answer the original question atleast: Is there any way to build cloudron apps without publishing the app to docker hub? Yes, definitely.
Also, the "build service" is really just an exotic "docker build && docker push" done on the server side (instead of building and pushing from your laptop). You might ask why this is needed. This was mostly done because we work a lot out of coffee shops and libraries. Docker images, being large in size, usually cannot be pushed in public wifi. So, instead what we do is: upload just the package source code to the server and the server does the docker build and push.
This also means that if you have good internet access, you can just skip this build service stuff altogether.
The steps to create your app with a private registry are:
docker build -t myregistry/myapp:1.0.0 .
docker push myregistry/myapp:1.0.0
- you might have to docker login etc for this to work.- Images can be private or public. For example, all our appstore docker images are public, so it needs no authentication. If your images are private, you have to configure Cloudron with registry credentials - https://docs.cloudron.io/settings/#private-docker-registry
cloudron install --image myregistry/myapp:1.0.0
-
@girish I believe your instructions still result in the image that was built being pushed to docker hub.
Regardless of whether the image is marked private or public in docker hub, for compliance reasons we cannot use docker hub as a cloud service, private or public.
-
@ChristopherMag that is correct, it will be pushed by default to the docker hub. If using a private docker image registry, then you have to use this feature https://docs.cloudron.io/settings/#private-docker-registry
-
@ChristopherMag said in Is there any way to build cloudron apps without publishing the app to docker hub?:
@girish I believe your instructions still result in the image that was built being pushed to docker hub.
Not really, the format I used in the examples is <registry>/repo:tag . registry can be your registry. only if registry is missing, it will attempt docker hub.
@ChristopherMag that is correct, it will be pushed by default to the docker hub.
But I used myregistry in my examples. Wondering if I am missing something.
(note repository != registry)
-
@girish Your completely right, I didn't catch the wording and I was wrong.
I don't know of a way to have a registry on cloudron that isn't a domain, not just a host, so what makes more sense to me is seeing it has
docker build -t myregistry.cloudron.somedomain.com/myapp:1.0.0 .
Unless there is a way to alias a single hostname like
myregistry
to a more complete domain name.I haven't tested this but maybe docker will by default use the dns suffix learned from DHCP or manually configured as the suffix to
myregistry
so if you happen have cloudron hosting apps on the domain that matches your computers dns suffix then maybe you could specifymyregistry
and the rest would be properly inferred. -
@ChristopherMag good point I will remember to use
user.myregistry.com
or something like that next time!