Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/falkz/dockeridoo
https://github.com/falkz/dockeridoo
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/falkz/dockeridoo
- Owner: FalkZ
- License: mit
- Created: 2024-03-31T18:16:09.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-20T18:57:02.000Z (6 months ago)
- Last Synced: 2024-05-20T22:12:05.561Z (6 months ago)
- Language: JavaScript
- Size: 490 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Dockeridoo
![Dockeridoo Mascot](https://raw.githubusercontent.com/FalkZ/dockeridoo/main/dockeridoo.png)
> The "easiest" way to run docker images as cli tools.
## Motivation
I wanted to create an simple tool to run as a cli tool. The main problem was, that I ran my tool on ARM architecture and wanted to run it on x86 as well. The cross compilation was quite straight forward, with the docker cli:
```bash
docker buildx build --platform linux/amd64,linux/arm64 ...
```The main problem was, that I wanted other people to use my tool and the default way to run a docker image requires the following steps:
1. Start Docker Deamon
2. Pull a current Image
3. Run the Image and attach the current working directory as a volumeThis is quite a lot of steps for a simple cli tool. Thats why I created this tool to run docker images with as little friction as possible.
## Usage
1. Prerequirements
- Docker
- NodeJS
2. Install Dockeridoo:
```bash
# npm
npm i -g dockeridoo
```
3. Run an docker image as cli tool:
```bash
dodoo [image name]
# for example
dodoo fa7k/create-cards
```## How it works
1. It detects if docker is already running on your system.
If not, it starts the docker deamon.
2. It pulls the latest image specified in the command.
3. It runs the image with the current working directory as a volume. And any command line arguments will also be passed to the image.## Create your own Dockeridoo compatible CLI Tool
**Dockerfile:**
```Dockerfile
FROM alpine:3.19 # choose a base image (preferably small)# do whatever you want here
# These 2 lines are important to make the image work with Dockeridoo.
# The directory you started Dockeridoo will be supplied as the volume /workdir
# This way files from the host system can be accessed inside the container
VOLUME /workdir
WORKDIR /workdirENTRYPOINT ["your_cli_tool.sh"]
```If you want your cli tool to be compatible across achitectures, you can use the following command to build your image:
```bash
docker buildx build --platform linux/amd64,linux/arm64 -t your_image_name .
```> Hint: make sure your base image was also built for multiple architectures 😉