Git Product home page Git Product logo

rind's Introduction

rind - Run IN Docker

CircleCI GitHub Release pre-commit Renovate FOSSA Status LICENSE GitHub Release pre-commit


rind - Run tasks in dockerized environments, avoiding Docker in Docker (dind) and crazy workarounds.

Features

  • Run any command in docker or using the native environment
  • Configurable log levels
  • Structured outputs
  • Terraform support

Requirements

Runtime

Usage

  • Install on your target system and use the rind command:

    bash <(curl -sS https://raw.githubusercontent.com/timo-reymann/rind/main/installer)
  • Download and directly pipe to bash

    curl -sS https://raw.githubusercontent.com/timo-reymann/rind/main/core/rind | bash -s - --log-level DEBUG
  • Use the terraform module

Motivation

Sometimes you have linux dependencies or tool chains you don't want to install locally but already have in your pipelines.

For example:

  • python lambda that also uses deterministic-zip and includes dependencies that install native parts for linux
  • you want to run a script that only works on *nix and don't want to adopt that it works on MacOS

You could run this locally on MacOS or even on a *nix-system and than would have problems with different target architectures.

So you could use always a docker container to run this tasks, but when you use CI you probably already use Docker for the job itself.

Using docker in docker is painful and not supported for all providers, so why not getting the best out of both worlds? - This is where rind comes in.

Contributing

I love your input! I want to make contributing to this project as easy and transparent as possible, whether it's:

  • Reporting a bug
  • Discussing the current state of the configuration
  • Submitting a fix
  • Proposing new features
  • Becoming a maintainer

To get started please read the Contribution Guidelines.

Development

Requirements

Documentation

Implementation

  • Pure bash (posix compliant) + docker cli
  • Decide based on /.dockerenv OR cgroup if we are running inside a container or not
  • In container
    • Delete artifacts
    • Run setup
    • Run main
  • On hosts
    • Copy current directory to build context
    • Delete artifacts to avoid readonly limitations
    • Run setup
    • Run main
    • Create image as volume container
    • Copy files to host

Notes on implementation

Why not just mounting the entire directory?

Copying files and small file changes are slow especially on MacOS. The ADD and COPY instructions are a LOT faster and workaround this problem.

This also allows docker layer cache to speed up your executions e.g. for terraform modules that build some code as part of the apply.

Why making a difference between docker/local?

Docker in Docker is leading to a lot more problems and is a workaround itself. In most cases we already run in docker context due to an CI pipeline etc. So it makes sense to distinguish and make things easier and faster.

Modules

The project is split into multiple modules, each contains a guide on how to develop/test:

  • core - Contains the core logic of rind
  • terraform - Terraform module
  • examples - Examples showcasing what you can do with rind
  • installer - "curl-able" installer

rind's People

Contributors

dependabot[bot] avatar renovate[bot] avatar timo-reymann avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

fossabot

rind's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

circleci
.circleci/config.yml
  • terraform-utils 3.0.0
  • semantic-release 5.1.1
  • go 1.10.0
  • cimg/go 1.21
  • cimg/node 16.17
pre-commit
.pre-commit-config.yaml
  • pre-commit/pre-commit-hooks v4.5.0
  • syntaqx/git-hooks v0.0.18
  • matthorgan/pre-commit-conventional-commits 20fb963
  • antonbabenko/pre-commit-terraform v1.86.0
terraform
terraform/main.tf
  • null >= 3.1.1

  • Check this box to trigger a request for Renovate to run again on this repository

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.