Code Monkey home page Code Monkey logo

Comments (10)

lorenzo93 avatar lorenzo93 commented on September 28, 2024 1

Hi,

as in the other issue I'm sorry for answering so late!
Also this change seems to work perfectly, I didn't test it in all my use cases for lack of time but in the base ones works!

Thank you!

PS is there a way I can offer you a beer? maybe through a donation link. You were very helpful for me and my project and I'd like to say thank you in the proper way! ;)

from fluentdocker.

mariotoffia avatar mariotoffia commented on September 28, 2024

Hi @lorenzo93 , I've not tried this myself - however I know people have used remote docker on e.g. digital ocean etc. What they do is register the remote docker daemon as a docker-machine (see https://www.kevinkuszyk.com/2016/11/28/connect-your-docker-client-to-a-remote-docker-host/) and use the UseMachine() and specify the machine name and the fluent API will look this up in the docker-machine registry and use it's URL and Certificates for communication. Please have a go and tell me if you had any success. Otherwise I'll have a go as well.

I will be adding a way to create a docker host with only url and cerificates (without register it to machine) in the fluent api later on (but that would not be an easier thing to use, just different).

Cheers,
Mario

from fluentdocker.

mariotoffia avatar mariotoffia commented on September 28, 2024

@lorenzo93 I have checked in, but not tested or released a remote ssh builder to have a fluent access to remote docker daemons using ssh. You still need to (as descibed in above tutorial link):

  • ssh-keygen -t rsa
  • ssh-copy-id {username}@{host}
  • sudo nano /etc/sudoers (And add the following to the end of the file where {username} is your username on the remote machine: {username} ALL=(ALL) NOPASSWD:ALL)
  • Make sure 2376 port is open on your firewall

Now you can ssh to the machine and communicate with the remote docker daemon. It is now possible to use

Hos().UseSsh("ip to remote daemon").Name("name-of-your-connection").Build();

Now you have a host that talk to the remote docker daemon. As I said, I haven't tried it yet (have to wait until the weekend to setup this test). If it succeeds I'll make a release this weekend.

Cheers,
Mario

from fluentdocker.

lorenzo93 avatar lorenzo93 commented on September 28, 2024

I'm sorry but maybe I misunderstand your first reply.
With current NuGet version (2.4.0) I couldn't find anywhere the UseMachine() command.
Here there is an example of what I tried

new Ductus.FluentDocker.Builders.Builder().UseMachine() .DefineImage(ImageName).ReuseIfAlreadyExists() .FromFile(DockerfilePath) .Build();

from fluentdocker.

mariotoffia avatar mariotoffia commented on September 28, 2024

Yes, the 2.4.0 do not have the above builder. I need to test it first. Meanwhile you can if you want instantiate a dockerhost using only a name. This name must match a machine name where you have done the remote configuration. This host will then communicate with the remote docker daemon. I need to setup a remote docker somewhere so I can test my new code before doing a new release, sorry...

Cheers,
Mario

from fluentdocker.

mariotoffia avatar mariotoffia commented on September 28, 2024

@lorenzo93 I have now tested and committed the code to use one way of accessing remote docker daemons and defining those connections.

Please use the release 2.5.0 if you want to try it out. There's a new section in the documentation about connecting (and preparing for remote connections) at https://github.com/mariotoffia/FluentDocker#connecting-to-remote-docker-daemons.

Please note that it will re-use an already existing named connection but if it has to create a new one it will take considerable amount of time!

I would love to get your feedback on this!

Cheers,
Mario

from fluentdocker.

lorenzo93 avatar lorenzo93 commented on September 28, 2024

Thank you very much!!!

I'll give you a feedback on Monday (maybe Tuesday) when I'll be at work.

Cheers,
Lorenzo

from fluentdocker.

mariotoffia avatar mariotoffia commented on September 28, 2024

Perfect and I did a small change so use the 2.5.1 release instead.

from fluentdocker.

mariotoffia avatar mariotoffia commented on September 28, 2024

Since I haven't heard from you and I have myself successfully tested this feature both in windows and Linux - I'm closing this issue now. But if you have trouble, please don't hesitate to reply in this thread and I'll open it again.

from fluentdocker.

mariotoffia avatar mariotoffia commented on September 28, 2024

Thanks for the offer! :) Haven't thought about that. I'll think of something - but it will always be free and highly free willingly to donate.

Cheers,
Mario

from fluentdocker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.