datawire / forge

Define and run multi-container apps in Kubernetes
http://forge.sh
Apache License 2.0
416 stars 43 forks source link

Support for deploying from a local docker registry #145

Closed majelbstoat closed 6 years ago

majelbstoat commented 6 years ago

Docker for Mac now ships with Kubernetes, which can load images directly from the local Docker container cache. (Minikube can do the same.)

When developing, I don't need or want to push my dev images to GCR. I want to build, without pushing, and deploy from the local tagged build.

However, there doesn't currently seem to be a way to construct a forge.yaml such that the local Docker image cache is used. I tried generic with -, but it tried to load from https://-/ :joy:

rhs commented 6 years ago

Would an option to forge build that simply skips the push entirely work for this use case, maybe with a per profile customizable default? I think pushing to a local registry would be a noop anyways.

majelbstoat commented 6 years ago

Yes! docker build -t blah already creates blah:latest locally.

rhs commented 6 years ago

I've released 0.4.3 with a new "local" type of docker registry. I think in combination with #146 that will work the best, but definitely let me know how it works out. ;-)

sachingade20 commented 6 years ago

@rhs I cant see local option in latest release and my local insecure registry doesnt seem to be working with forge setup

║ Registry type (one of ecr, gcr, generic)[generic]: ║ Docker registry url[registry.hub.docker.com]: localhost:5000 ║ Docker user (use "-" to leave unspecified): admin ║ Docker password: ║ Docker namespace/organization (enter username again for standard accounts): admin ║ ║ registry: {type: docker, url: 'localhost:5000', user: admin, password: 'XXXXX' namespace: admin} ║ ║ docker login -u admin -p localhost:5000 ║ WARNING! Using --password via the CLI is insecure. Use --password-stdin. ║ Login Succeeded ║ docker pull registry.hub.docker.com/datawire/forge-setup-test:1 ║ 1: Pulling from datawire/forge-setup-test ║ cfc728c1c558: Pulling fs layer ║ cfc728c1c558: Verifying Checksum ║ cfc728c1c558: Download complete ║ cfc728c1c558: Pull complete ║ Digest: sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96 ║ Status: Downloaded newer image for registry.hub.docker.com/datawire/forge-setup-test:1 ║ docker tag registry.hub.docker.com/datawire/forge-setup-test:1 localhost:5000/admin/forge_test:dummy ║ docker push localhost:5000/admin/forge_test:dummy ║ The push refers to a repository [localhost:5000/admin/forge_test] ║ e154057080f4: Preparing ║ e154057080f4: Pushed ║ dummy: digest: sha256:11a6af2edd09100d7a35abacacefd269404cf44aff537668235321d4f4caa485 size: 528 ║ GET https://localhost:5000/v2/admin/forge_test/manifests/dummy ║ 16 tasks run, 1 errors ║ setup: HTTPSConnectionPool(host='localhost', port=5000): Max retries exceeded with url: /v2/admin/forge_test/manifests/dummy (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10a46f910>: Failed to establish a new connection: [Errno 61] ECONNREFUSED',)) ║ ║ -- please try again --

jmcclell commented 5 years ago

For a newcomer, having the "setup" function not "just work" for the local registry is really frustrating. I have a local k8s cluster running with Docker for Mac, I don't have a need for an external registry for dev. This has to be a common use case.

It's frustrating because I have to google for the issue, then I find this closed issue which tells me it's fixed, but then I see that it's not actually fixed (as of v0.4.15) because forge setup still has no idea that local is a valid option for Registry type. Then I find another issue pointing to the docs for creating the forge.yaml file by hand, and now I have to use that to figure out what the config file should actually look like without having any examples to go by. The documentation for the YAML file tells me about all the fields available, but doesn't actually show me an example. Are these all top level fields? Are they part of some larger configuration context?

I'm just trying out Forge for the first time and it takes an extra 15 minutes just to complete a simple Getting Started guide. I can tell a lot of effort has been put into the docs and making forge accessible to newcomers, but this seems like a bit of an oversight.

For anyone else going through the same thing, your forge.yaml file just needs to look like this:

---
registry:
    type: local