Skip to content

dfrun is a CLI that runs Dockerfile instructions directly as shell commands.

License

Notifications You must be signed in to change notification settings

magichourhq/dfrun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dfrun - Dockerfile Runner

Cover Image Generated by Magic Hour's AI Image Generator

dfrun is a simple command-line tool that runs Dockerfile instructions directly as shell commands.

It's useful for getting setup on a local environment without having to install docker.

For example:

  • Using VSCode Remote SSH on a fresh remote server.
  • Configuring a AI/ML Dockerfile to run locally

Features

  • 🚀 Runs Dockerfile commands directly in your shell
  • 🔄 Supports multi-line RUN commands
  • 📥 Handles ADD commands for downloading files
  • 🌍 Sets ENV variables
  • 💬 Interactive ARG prompts with default values
  • 📁 Respects WORKDIR instructions
  • 🐛 Debug mode for troubleshooting

Installation

From Releases

Download the latest release for your platform from the releases page.

macOS

Arm Based Macs

# Download and extract
tar -xzf dfrun-macos-arm64.tar.gz
# Move to a directory in your PATH
sudo mv dfrun /usr/local/bin/

Intel Based Macs

# Download and extract
tar -xzf dfrun-macos-x86_64.tar.gz
# Move to a directory in your PATH
sudo mv dfrun /usr/local/bin/

Linux

# Download and extract
tar -xzf dfrun-linux-x86_64.tar.gz
# Move to a directory in your PATH
sudo mv dfrun /usr/local/bin/

Windows

# Extract the archive and add to your PATH

From Source

Reference https://www.rust-lang.org/tools/install to install cargo onto your system.

cargo install --git https://github.com/magichourhq/dfrun

Usage

Basic usage:

cd /dir/with/Dockerfile
dfrun

With a specific Dockerfile:

dfrun -f path/to/Dockerfile

With debug output:

dfrun --debug

Supported Dockerfile Instructions

WORKDIR: This command is ignored.

WORKDIR /app

RUN: Executes shell commands

RUN echo "Hello, World!"

ENV: Sets environment variables

ENV MY_VAR=value

ARG: Prompts for values with optional defaults

ARG VERSION=1.0
ARG USER

ADD: Downloads files from URLs

ADD https://example.com/file.txt .

Development

Requirements:

  • Rust 1.70 or later
  • Cargo

Setup:

# Clone the repository after forking
git clone https://github.com/magichourhq/dfrun
cd dfrun

# Install locally
cargo install --path .

# Build
cargo build

# Run tests
cargo test

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

dfrun is a CLI that runs Dockerfile instructions directly as shell commands.

Resources

License

Stars

Watchers

Forks

Packages

No packages published