Skip to content

moduleon/deckor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deckor

A developer tool to make you forget that Docker is running.

Overview

Docker and docker-compose offer tremendous utility. However, their usage often entails composing lengthy commands for simple tasks.

For instance, in a pre-Docker scenario while working on a JavaScript project, launching your app was as simple as:

npm run dev

Yet, with Docker, it has become something more convoluted 😅:

docker compose run --rm -u 1000:1000 app npm run dev

Consequently, various scripts are concocted to manage these complexities—installing dependencies, running the app, or building it. As this approach isn't conventional, it's usually mentioned in a README, hoping that users take notice.

Deckor proposes an alternative solution: a reversal to the previous simplicity while still leveraging Docker. The idea is to interact with the terminal as if Docker weren't present. To achieve this, Deckor utilizes aliases that come into play exclusively within your project directory.

Requirements

For now, Deckor is only supported on Linux and Mac OS.

Installation:

  1. Obtain this project from GitHub

Clone it locally, or download and uncompress it.

  1. Terminal Installation

Run the following command in your terminal from the deckor project folder:

./install

This will install Deckor CLI globally on your machine.

Verify if installation was successful:

deckor

Usage

Setup aliases within Docker-Compose Files

  1. Alias declaration

Declare aliases as labels in your docker-compose file. Ensure the syntax of the declared label follows this structure: deckor.alias.<alias>=<command>

For instance:

# docker-compose.yml
version: '3.4'
services:
    app:
    image: node:16-alpine
    volumes:
        - ${PWD}:/app
    working_dir: /app
    labels:
        - "deckor.alias.node=docker compose run --rm -u $(id -u):$(id -g) app node"

Tip

Check out our examples for various other languages.

  1. Call Deckor

From your project directory containing the docker-compose file, execute the following:

deckor alias init

Now, your alias is accessible from this directory (only):

node --version

Manually setup aliases

You can also use Deckor outside of docker-compose.

For example:

deckor alias add node "docker run --rm -v ./:/app --workdir /app node:16-alpine node" --reload

Now, your alias is accessible from this directory (only):

node --version

Other commands

  1. Managing aliases

Deckor comes with others commands allowing to manage aliases in your terminal:

command description
deckor alias ls  List all aliases for the current directory
deckor alias clean Remove all aliases for the current directory
deckor alias rm <alias> Remove a specific alias for the current directory
  1. Docker compose overlay

Instead of calling deckor init to set up aliases, then docker compose to start or stop your containers, you can directly call :

deckor compose up -d
deckor compose down

It's an overlay for doing both things.

Roadmap

  • Add support for Linux
  • Add support for Mac OS
  • Add support for Windows

License

This project is distributed under GPL licence v3 for always keeping it open source.

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages