Giter Site home page Giter Site logo

dockerized's Introduction

Dockerized

Run popular commandline tools without installing them.

dockerized <command>

demo

Supported commands

If your favorite command is not included, it can be added very easily. See Add a command.
Dockerized will also fall back to over 150 commands defined in jessfraz/dockerfiles.

  • Web Development
    • http
    • jq
    • protoc
    • swagger-codegen
    • wget
  • Git
  • Cloud
  • Docker
    • helm
  • Languages & SDKs
    • dotnet
    • go
    • php
    • node
      • npm
      • npx
      • tsc
      • vue
      • yarn
    • python
      • pip
      • python
      • python2
  • Unix
    • tree

Installation

  • Install Docker
  • Clone this repo anywhere: git clone [email protected]:datastack-net/dockerized.git
  • Add the bin directory to your path

Usage

Run any supported command, but within Docker.

dockerized <command>

Examples:

dockerized node --version             # v16.13.0
dockerized vue create new-project     # create a project with vue cli
dockerized tsc --init                 # initialize typescript for the current directory
dockerized npm install                # install packages.json

Use Cases

  • Quickly try out command line tools without the effort of downloading and installing them.
  • Installing multiple versions of node/python/typescript.
  • You need unix commands on Windows.
  • You don't want to pollute your system with a lot of tools you don't use.
  • Easily update your tools.
  • Ensure everyone on the team is using the same version of commandline tools.

Design Goals

  • All commands work out of the box.
  • Dockerized commands behave the same as their native counterparts.
    • Files in the current directory are accessible using relative paths.
  • Cross-platform: Works on Linux, MacOS, and Windows (CMD, Powershell, Git Bash).
  • Suitable for ad-hoc usage (i.e. you quickly need to run a command, that is not on your system).
  • Configurability: for use within a project or CI/CD pipeline.

Switching command versions

Each command has a <COMMAND>_VERSION environment variable which you can override.

  • python: PYTHON_VERSION
  • node: NODE_VERSION
  • tsc: TSC_VERSION

Notes:

  • Versions of some commands are determined by other commands.
    For example, to configure the version of npm, you should override NODE_VERSION.
  • See dockerized.env for a list of configurable versions.

Global

  • Create a dockerized.env file in your home directory for global configuration.

    # dockerized.env (example)
    NODE_VERSION=16.13.0
    PYTHON_VERSION=3.8.5
    TYPESCRIPT_VERSION=4.6.2
  • List of configuration variables, and defaults:

Per directory

You can also specify version and other settings per directory. This allows you to "lock" your tools to specific versions for your project.

  • Create a dockerized.env file in your project directory.
  • All commands executed within this directory will use the settings specified in this file.

Ad-hoc (Unix)

  • Override the environment variable before the command, to specify the version for that command.

    NODE_VERSION=15.0.0 dockerized node

Ad-hoc (Windows Command Prompt)

  • Set the environment variable in the current session, before the command.

    set NODE_VERSION=15.0.0
    dockerized node

Ad-hoc (Windows Powershell)

It's currently not known how to specify the version of a command in a Powershell script through environment variables.

As an alternative, you can create a dockerized.env file in the current directory.

Limitations

  • It's not currently possible to access parent directories. (i.e. dockerized tree ../dir will not work)
    • Workaround: Execute the command from the parent directory. (i.e. cd .. && dockerized tree dir)
  • Commands will not persist changes outside the working directory, unless specifically supported by dockerized.

dockerized's People

Contributors

boukeversteegh avatar

Watchers

James Cloos avatar

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.