Building custom app - authentication problem
-
-
@ekevu123 Maybe we continue here, it's not a problem (for us atleast). Can you tell us what issue you are facing when trying to build the image ?
For a start, let's ignore the Cloudron aspects and just try to build the docker image. Are you able to
docker build -t your_username/customimage .
? What is the output ? -
@BrutalBirdie said in Building custom app - authentication problem:
"dockerImage": "link-to-image:tag",
For my education, is this line needed in the manifest file? because we are building the Dockerfile to produce an image.
I've never used this line when building a custom package -
@timconsidine right, that line is not needed and not correct. One shouldn't specify a static docker image in the manifest.
-
We can continue here, I just thought if I am supposed to share more personal information like repo access, then we can do this privately. But alright, I appreciate the help I am getting here!
Regarding the questions above:
-
I have removed the link to the docker image from the Cloudron manifest and tried to run "cloudron build" again, which gets me stuck here again:
Step 4/6 : RUN pip install --no-cache-dir -r requirements.txt
---> Running in e834d414ac34 -
Now I am trying to build the docker image without Cloudron, see above, and I am getting the same issue.
The requirements file I am getting stuck with looks like this:
asgiref==3.6.0
beautifulsoup4==4.12.2
certifi==2022.12.7
(and more following)It doesn't help to simply delete a few requirements, it will always hang with the first one in the file.
-
-
@ekevu123 yes, no worries Just wanted to continue here since so far it's mostly something docker related and not cloudron related as such.
It seems this is a general Docker building issue. So, much depends on your platform / OS as well. Is this a Mac or Windows or Linux ?
Usually, the best way to debug Docker build issues is something like:
- First run,
docker run -ti cloudron/base:4.0.0 /bin/bash
. This will give you a bash prompt. - Now, execute the commands in your Dockerfile one by one in the prompt and see where it breaks.
- First run,
-
@girish said in Building custom app - authentication problem:
Usually, the best way to debug Docker build issues is something like:
that's a cool "trick"
-
I know where it breaks, when downloading the python requirements. But I found the issue - apparently, you can not do that when being on VPN.
Now I get this error message in the end:
error parsing HTTP 403 response body: invalid character '<' looking for beginning of value: "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n"
Failed to push image (are you logged in? if not, use "docker login")However, I am logged in (I ran "docker login" right before executing "cloudron build").
-
@ekevu123 That's good progress! Not sure where you are pushing to, did you set the right image name ? You can try
cloudron build --set-repository
. Here, you should enter something likeekevu123/appname
(whereekevu123
is your docker hub username and appname is the repository). -
Thank you very much, we are getting somewhere!
I got to run "cloudron install --image" after building the docker successfully. But I ran into another particular problem.
Firstly, when running the command, I got this error message:
App installation error: Installation failed: Unable to pull image PATH. message: (HTTP code 404) unexpected - pull access denied for PATH, repository does not exist or may require 'docker login': denied: requested access to the resource is denied statusCode: 404So, I made sure I was logged in.
Secondly, I tried to run the command again and got this:
Failed to install app: 409 message: primary location 'PATH' is in use
(I could probably just specify a new path, it's not critical, but to keep it clean it would be great to know how to delete the failed attempt)However, the Cloudron dashboard doesnt load anymore. It stays grey. If I try to log in in another browser, I get to the login mask, after putting in my details, I just see a grey screen. Fortunately, apps seem to work still, I can access them separately.
Independently of the actual docker error, that is an odd behaviour. I'll try to go through the tutorial for how to save cloudron next unless I see something specific in this thread.
-
@ekevu123 said in Building custom app - authentication problem:
and uninstalling the app via CLI immediately solved it.
FWIW when I am building a custom app and I make changes to the Dockerfile, it is my standard process to uninstall the last app version before seeking to build and deploy the next version.
Technically this might be unnecessary, but for my little brain, I find it easier to know that I am starting 'clean'.
I usually uninstall via the app's settings screen, but I guess from CLI is same and might be easier if you're working on command line anyway.I also use a little script
cld.sh
(call it whatever you want, I save keystrokes where possible) :#/bin/bash docker build --no-cache -t $1 . docker push $1 cloudron install --image $1
and I run this it this :
./cld.sh <repository_url>/<app_name>:<tag>
I hack my way through multiple trial-and-error builds, and this saves a lot of time, keystrokes and typos.Maybe you have your own workflow efficiencies
-
To summarise, my issue is this. When running "cloudron build", I get this error:
error parsing HTTP 403 response body: invalid character '<' looking for beginning of value: "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n"
Failed to push image (are you logged in? if not, use "docker login")But I ran docker login before this step. I completely deleted all Cloudron CLI configuration and re-installed it without any effect.