Git Product home page Git Product logo

Comments (5)

AlexZeitler avatar AlexZeitler commented on August 11, 2024 1

A possible workaround: You could build the Image locally (using Dockerode) so that all required files are included. Then you push the images to a registry and after that you run docker-compose using the --host option and the host pulls the images from the registry now.

The other option would be using scp (either native or wrapped using Node child_process).

from docker-compose.

Steveb-p avatar Steveb-p commented on August 11, 2024

Dockerode uses Docker API directly. It communicates with Docker endpoint (socket or tcp).

This package uses docker-compose system binary, which in turn executes commands vs. Docker API. So they work on fundamentally different layers.

That being said, nothing stops you from using Dockerode inside the same code that uses this package.

If you simply want to communicate with a remote docker API, then what you want to do is provide an option (--host) when executing functions exposed here.

EDIT: see https://pdmlab.github.io/docker-compose/#options

EDIT2: There is also a DOCKER_HOST environment variable I think. However keep in mind that by default we do not pass current environment into functions (for security reasons) so if you want to use it, you will still need to pass it into env option.

from docker-compose.

pedroricardo avatar pedroricardo commented on August 11, 2024

thanks for the reply, leaving the dockerode aside and just using the docker-compose module. can I run the docker-compose module on a remote host?

Keeping in mind that my biggest problem is to copy the files to build the image and start the container on a remote host through a docker-compose.yml

Does your module accept options --host in compose.up() ?
is there any documentation on this somewhere on how i can make this work?

from docker-compose.

AlexZeitler avatar AlexZeitler commented on August 11, 2024

Does your module accept options --host in compose.up() ?
is there any documentation on this somewhere on how i can make this work?

In general you can pass all docker-compose and all docker-compose command options to the lib.

docker-compose options like --host are called composeOptions: https://pdmlab.github.io/docker-compose/#options

You have to make sure you're using composeOptions because there are also commandOptions which vary by command.

from docker-compose.

pedroricardo avatar pedroricardo commented on August 11, 2024

I understand, I managed to use --host in compose, now the problem is that I realized that the files that are in the COPY of the dockerfile are not copied to the remote host, so the container does not start (I need to send folders and some files.js) I don't know if there is any workaround to do this. I didn't want to have to use scp before docker-compose but if you don't have another way it will be the way.

from docker-compose.

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.