I am in an environment where based on our compliance requirements I cannot publish images to docker hub.
I have the Cloudron Build Service and Docker Registry apps installed on my cloudron instance.
I am trying to follow this tutorial to build a node js app.
I have cloned the sample app but when I look at the Build steps if I follow the steps I believe it would push the image to docker's public registry.
It seemed like possibly using the cloudron build service would address this so I installed that app and walked through the article on the app but it is not clear how to configure this to use the private registry hosted on cloudron.
I have updated the docker.json
file to be:
{
"cloudronbuildservice.cloudron.ourdomain.com: {
"username": "email@address.com",
"password": 'passwordthatcontians"character'
}
}
I have also tried cloudron build --set-repository https://dockerregistry.cloudron.ourdoma8in.com/ourappname
and I get the following error:
Using build service https://cloudronbuildservice.cloudron.ourdomain.com/
Building https://dockerregistry.cloudron.ourdomain.com/magnusonfinancialwebservices:20230914-165206-408b2a393
Uploading source tarball...
Failed to build app (statusCode 404):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST //api/v1/builds</pre>
</body>
</html>
This seems to be looking at the repository as the source for the code to build and not as the destination for what is built so I think I must not be understanding how this is supposed to work.
Trying to do a build without using the cloudron build service I looked at @timconsidine 's example here and it seems like I should be to run the following from the directory where the code from the nodejs sample app was cloned, docker build -t https://dockerregistry.cloudron.ourdomain.com/ourappname:v1 .
This results in the error:
[+] Building 0.0s (0/0) docker:default
ERROR: invalid tag "https://dockerregistry.cloudron.ourdomain.com/ourappname:v1": invalid reference format
The source code for this app will be hosted in gitea also on our cloudron instance and my intent is to have a workflow that takes the dockerfile from the gitea repo, uses the cloudron build service to build the app, publishes it to the docker repository hosted on cloudron, and then I can us the cloudron cli tool to install it on the cloudron server.
I am happy to work up to this in stages but I seem to be missing something about how even the basics of the process should work using docker to build it locally if I don't want to user dockerhub.
What can I do to build the sample app without using dockerhub?
Thanks for your help,
Chris