🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

docker-services-deployer

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docker-services-deployer

Simply Tool for deploying your services to Docker

latest
npmnpm
Version
1.4.0
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

docker-services-deployer

A simple tool for deploying your services to Docker.

Usage

$ npm install -g docker-services-deployer
$ docker-services-deployer <config-file>

Note that <config-file> can be a local file on disk or a remote url, e.g. a file on S3, an api endpoint, or whatever.

Config file

There are two parts to the config file, your 'docker' options, and the definition of your services that you want to deploy to docker.

{
  docker: {
  },
  services: [{
    "name": "service1",
    "registry": "mydockerregistry.somewhere.com/myorg/service1",
    "tag": "latest"
    "port": 1234,
    "links": ["service2:service2"],
    "cmd": [
      "node",
      "service.js"
      ],
    "env": [
      "FOO=bar",
      "FOO2=bar2"
    ]
  }]
}

The docker config object gets passed on directly to dockerode, see there for details.

Note that link and port are optional above.

Also note that one additional environment variable is set: DOCKER_HOST_IP, and is set to the hosts eth0 ip address (this is an alternative way of enabling services to talk to each other).

What it does / how it works

docker-services-deployer connects to docker, and then does the following to make sure docker is running the specified services at the correct version (tag):

  • first it checks your service image is up to date by pulling the image from the remote docker registry
  • if the image is already up to date, it checks you have a container for that service based off that image and that the container is running
  • if pulled image is different, it will stop and remove the existing container for this image (if it exists), and then creates a new container based of the new pulled image and runs it
  • the name, port, cmd and env from your service definition are all used when creating a container

License

MIT

Thanks to nearForm for sponsoring this.

FAQs

Package last updated on 28 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts