https://github.com/ducttape-infra/machinefile
A simple executor that allows you to run `Dockerfile`/`Containerfile` commands directly on a local or remote host
https://github.com/ducttape-infra/machinefile
build-tool containerfile containerfiles containers deploytool devops-tools docker dockerfile dockerfiles infrastructure-as-code podman
Last synced: about 9 hours ago
JSON representation
A simple executor that allows you to run `Dockerfile`/`Containerfile` commands directly on a local or remote host
- Host: GitHub
- URL: https://github.com/ducttape-infra/machinefile
- Owner: ducttape-infra
- Created: 2025-03-01T02:27:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-06-24T03:24:28.000Z (5 days ago)
- Last Synced: 2026-06-25T04:11:25.316Z (4 days ago)
- Topics: build-tool, containerfile, containerfiles, containers, deploytool, devops-tools, docker, dockerfile, dockerfiles, infrastructure-as-code, podman
- Language: Go
- Homepage:
- Size: 1.73 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Machinefile
===========
[](https://github.com/ducttape-infra/machinefile/actions/workflows/build-process.yml) [](https://github.com/gbraad-actions/machinefile-executor-action/actions/workflows/build-process.yml) [](https://deepwiki.com/ducttape-infra/machinefile/)
A simple executor that allows you to run `Dockerfile`/`Containerfile` commands directly on the host system without using Docker, Podman or any other container engine. It's useful for executing build commands in a predictable environment or setting up development tools. The Machinefile executor tool parses the Dockerfile and executes the commands on the local or remote host system.
## Supported commands
The executor supports the followuing `Dockerfile` commands:
- `RUN`: Execute commands
- `COPY`: Copy files from context to a specific location
- `ADD`: Similar to COPY, but with additional features
- `USER`: Switch to different user
- `ENV`: Set environment variables
- `ARG`: Define build-time variables
## Usage
> [!NOTE]
> This should ideally be run as `root`.
```bash
$ ./machinefile test/Machinefile [context]
```
To target a remote machine, you have to set up remote keys:
```bash
$ ./machinefile -host dotfedora -user root test/Machinefile [context]
```
or
```bash
$ ./machinefile root@dotfedora test/Machinefile
```
### Passing arguments
```bash
# Single ARG
./machinefile --arg=USER="runner" test/Machinefile [context]
# Multiple ARGs
./machinefile --arg=USER="runner" --arg=VERSION="1.0" test/Machinefile [context]
# ARGs without quotes (if value doesn't contain spaces)
./machinefile --arg=USER=runner test/Machinefile [context]
```
## Shebang usage
If a Containerfile uses the following shebang option:
`Machinefile`
```dockerfile
#!/bin/env -S machinefile --stdin
FROM ...
RUN ...
```
it is possible to execute the file directly
```bash
$ ./Machinefile root@dotfedora --arg USER=gbraad [context]
```
## GitHub Action
To incorporate this in your build process, you can use the [Machinfile executor](https://github.com/gbraad-actions/machinefile-executor-action) GitHub Action.
```yaml
- name: Run Dockerfile commands
uses: gbraad-actions/machinefile-executor-action@v1
with:
containerfile: 'containers/Containerfile-devtools'
context: '.'
arguments: --arg=USER=gbraad
```
## Development
[](https://codespaces.new/ducttape-infra/machinefile)
## Author
| [](http://gbraad.nl "Gerard Braad ") |
|---|
| [@gbraad](https://gbraad.nl/social) |