1.0.4 • Published 2 years ago

@yvnbunag/dock v1.0.4

Weekly downloads
12
License
MIT
Repository
gitlab
Last release
2 years ago

@yvnbunag/dock

@yvnbunag/dock

npm version nodejs version codecov npms.io (quality) Known Vulnerabilities Continuous Integration Continuous Delivery license

A CLI tool to help manage and consume development environments containerized with docker and configured with docker-compose


Contents


When would I use dock?

  • If you need to manage your containerized development environment globally
  • If you need ease when managing your containers via CLI only due to limited development machine resources
    • When having to bring up or down specific containers for services currently being developed
    • When occasionally running commands in a container, without having to remember the engine command and options needed

What docker orchestration engines are currently supported?

Only docker-compose. Other engines may be readily supported


Requirements

  1. Docker (for Linux) version 19.03 or higher
  2. Docker Compose version 1.27 or higher

Installation

Globally with npm

npm install -g @yvnbunag/dock

Globally with yarn

yarn global add @yvnbunag/dock

Configuration

Before a project may be registered and used with dock, a dock configuration (dock.config.yml) must be present in the project directory, along with the docker-compose configuration

See Configuration Reference

name: library-system

containers:
  nginx:
    shell: sh
  mysql: {}
  node16:
    shell: sh

services:
  library-system:
    container: node16
    entry-point: ./applications/library-system
    install:
      - yarn
      - cp /shared/applications/library-system/.env .env
  library-system-api:
    container: node16
    entry-point: ./microservices/library-system-api
    install:
      - yarn
      - cp /shared/microservices/library-system-api/.env .env
      - yarn database:sync
      - yarn database:seed

modes:
  front-end:
    containers:
      - nginx
    services:
      - library-system
  back-end:
    containers:
      - nginx
      - mysql
    services:
      - library-system-api
  full-stack:
    containers:
      - nginx
      - mysql
    services:
      - library-system
      - library-system-api

Usage

Listed below are the commands to help you manage your development environments. You may use the built in help command for additional options and information

dock --help

# Or for specific commands
dock [command] --help

The dock command may be invoked without a sub command. See [root] command usage reference


completion

Show instructions to enable/disable dock completion

Enable completion

dock completion enable

Enable completion

Disable completion

dock completion disable

Disable completion


register

Register project

Register current directory

dock register

Register current directory

Register provided path to directory

dock register [path]

Register provided directory


projects

List registered projects

dock projects

List projects


use

Activate project for usage when invoking docker abstraction engine commands

dock use [project]

Use project


build

Build container/s or service container/s

Build all containers

dock build

Build all containers

Build specific container/s or service container/s

dock build [reference...]

Build specific references


install

Run install script/s for services

Run all install scripts

dock install

Build all containers

Run install scripts of specific service/s

dock install [service...]

Build specific references


up

Bring container/s or service container/s up

Bring up all containers

dock up

Bring up all containers

Bring up specific container/s or service container/s

dock up [reference...]

Bring up specific references


down

Stop and remove container/s or service container/s

Bring down all containers

dock down

Bring down all containers

Bring down specific container/s or service container/s

dock down [reference...]

Bring down specific references


mode

Switch running containers with provided mode container/s and service container/s

dock mode [mode...]

Switch to mode


open

Open interactive shell of container or service container

Open container

dock open [container]

Open container

Open service container

dock open [service]

Open service container


run

Run command in container or service container

Run command in container

dock run [container] [command...]

Run command in container

Run command in service container

dock run [service] [command...]

Run command in service container


root

Given that the first argument is not a command and current directory is a service reference:

  • Open interactive shell of service container if no arguments are provided
  • Run command in service container if arguments are provided

Open service container

dock

Open service container

Run command in service container

dock [service-command...]

Run command in service container


reload

Reload used project

dock reload

Reload used project

Command not needed to be used for every new change in the configuration file as project gets automatically reloaded every time a orchestration engine command is invoked


unregister

Unregister project

dock unregister [project]

Unregister project


Example Projects

See Library System Stack repository for example configuration and usage


Contributing

See Contributing Guide


Exit Codes

See Exit Codes Reference


Repository

See Repository

1.0.4

2 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.1-rc.1

3 years ago

1.0.1-rc.0

3 years ago

1.0.1-rc.2

3 years ago

0.21.0

3 years ago

0.20.0

3 years ago

0.19.0

3 years ago

0.18.0

3 years ago

0.17.0

3 years ago

0.15.0

3 years ago

0.16.0

3 years ago

0.13.0

3 years ago

0.14.0

3 years ago

0.12.0

3 years ago

0.11.0

3 years ago

0.10.0

3 years ago

0.10.1

3 years ago

0.9.1

3 years ago

0.9.0

3 years ago

0.8.0

3 years ago

0.7.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago