An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

shdocker


Dockerfiles with shell superpowers


AUR
License



&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.*