Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deploy image already present in the same caprover's host? No registry needed #1883

Open
frederikhors opened this issue Sep 15, 2023 · 5 comments

Comments

@frederikhors
Copy link

I'm using v1.11.0 and I'm building the image on the host where caprover runs.

So if I run docker images:

REPOSITORY                           TAG       IMAGE ID       CREATED          SIZE
my-amazing-image/web                 latest    1a52ecfad863   13 minutes ago   211MB

So I would like to deploy this image WITHOUT any registry.

I'm trying with deploy method 6 (or with caprover deploy --imageName ...) using:

my-amazing-image/web:latest

and the error is:

------------------------- Fri Sep 15 2023 22:09:25 GMT+0000 (Coordinated Universal Time)
Build started for app-name
An explicit image name was provided (my-amazing-image/web:latest). Therefore, no build process is needed.
Pulling this image: my-amazing-image/web:latest This process might take a few minutes.
Build has failed!
----------------------
Deploy failed!
Error: (HTTP code 404) unexpected - pull access denied for my-amazing-image/web, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

If I use deploy method 4 writing this:

FROM my-amazing-image/web:latest

it works!

Why?

I would like to use the CLI command caprover deploy --imageName my-amazing-image/web:latest.

@githubsaturn
Copy link
Collaborator

If I use deploy method 4 writing this, it works

Yes! This is exactly the workaround.

It's by design, since CapRover is meant to be able to pull images. Consider a case, where you have multiple nodes and you want to deploy an app that doesn't have any images on node 2. The images might get out of sync if they are local. I understand in your case, you probably have one node, but this is by design, because the architecture is designed for a multi-server environment.

@frederikhors
Copy link
Author

This makes perfect sense. You are right.

But can I ask you to unlock this feature if there is only one node?

I mean, if I use deployment method 6 and caprover detects that it's running on one node only can we have the image taken from the node and not from a registry?

Caprover can now already detect the presence of a single-node cluster.

This is super convenient when there are single node instances and there are more and more of them today as the servers are less and less expensive.

This saves us the trouble of managing a private registry.

It would be super convenient!

Please. 🙏

@githubsaturn
Copy link
Collaborator

What's the use case for an image that is available on the server? Even for a simple server, you still need to build the image first, right?

@frederikhors
Copy link
Author

Yeah. I'm building it manually. Using docker build.

I have one big server with caprover and I build images there too.

This way I do not need registry at all.

@githubsaturn
Copy link
Collaborator

Thanks for the context! I'll reopen this as a feature request. All we need to do is to ensure we check for locally available images and skip the pull

const providedImageName =
captainDefinition.imageName + ''

Feel free to open a pull request anytime.

@githubsaturn githubsaturn reopened this Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants