https://github.com/veracioux/shdocker
Don't repeat your Dockerfiles
https://github.com/veracioux/shdocker
bash docker shell template-engine
Last synced: 6 months ago
JSON representation
Don't repeat your Dockerfiles
- Host: GitHub
- URL: https://github.com/veracioux/shdocker
- Owner: veracioux
- License: mit
- Created: 2022-01-28T16:42:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-03T12:03:50.000Z (over 3 years ago)
- Last Synced: 2025-01-18T07:16:16.767Z (over 1 year ago)
- Topics: bash, docker, shell, template-engine
- Language: Shell
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
shdocker
Dockerfiles with shell superpowers
&2
exit 1
fi
TAG shdocker-example:"$base"
```
## Installation
```
make
sudo make install
```
**Dependencies:** `bash`, `docker`.
That's it. Or you can install using your package manager (currently only ArchLinux is
supported via AUR).
## How to use
The procedure is dead simple:
- Create a shDockerfile (or adapt an existing Dockerfile into one)
- Run `shdocker` with or without options
- End up with an actual Dockerfile or with a built docker image
##### Generate a Dockerfile from a shDockerfile
Just create a `shDockerfile` and run:
```
shdocker
```
This will automatically find the shDockerfile in the current directory and
output the generated Dockerfile content to stdout. You can be more specific and
specify the exact input (`shDockerfile`) and output (`Dockerfile`) files, like
so:
```
shdocker -s shDockerfile -d Dockerfile
```
##### Build a docker image directly from a shDockerfile
You just have to specify a context directory to `shdocker`:
```
shdocker -s shDockerfile -d Dockerfile .
```
Because we specified the `-d` option, a Dockerfile will be generated in the
current directory as a side-effect.
Actually, you can tell `shdocker` which options it should pass to `docker
build`. This is valid:
```
shdocker -s shDockerfile -- -t my-tag --quiet .
```
Note that the `--` is necessary so `shdocker` doesn't think you are passing the
`-t` and `--quiet` options to it, but to `docker build` instead.
## Documentation
If you have any questions, consult the `shdocker(1)` manpage. If you can't
find an answer there, you can open an issue, or ask in the [matrix chat](https://matrix.org/#/#shdocker-general:matrix.org).
## Contributing
Everyone is free to contribute. You can simply open a PR, but I'd prefer if you
opened an issue so we can discuss the changes first.
## Projects using shdocker
- [tuterm](https://github.com/veracioux/tuterm) - A better way to learn CLI programs
*P.S. Please let me know about your project. I'll be glad to put it here, or you
can do that yourself with a PR.*