mini-cross
Provides user configured development environments.
Configuration
---
base: ubuntu:18.04 # ①
install:
- nodejs # ②
- npm
publish:
- 8080:80 # ③
- 8443:443
---
#!/bin/bash
sudo npm install -g mini-cross # ④
The configuration file contains two sections: first a YAML frontmatter section followed by an optional shell script. Splitting the configuration into a declarative and an imperative section enables describing common operations with minimal boilerplate while still allowing arbitary actions.
-
base
describes the Docker image to be used as starting point for further setup. -
install
contains a list of packages to be installed from the distribution's package manager -
publish
contains a list of<host port>:<container port>
declarations describing port forwarding from host to container - A shell script containing arbritrary commands to be executed while creating the container's image
Since mini-cross needs to know how to install packages on a certain distribution, not all Docker images are supported as base images. Current support includes:
CLI
There two ways of invoking mini-cross
- The command invocation
- The shell invocation
While technically similar, they provide for different use cases. The first allows to run individual commands inside the development environment while remaining attached to the host shell. The second changes the point of view to the inside of the development environment so that multiple commands can be executed while attached to the same container.
Therefore the command invocation is more suitable for scripted usage while the second is crafted toward comfort for interactive use.
Command invocation
mini-cross <options>* <machine> <command>*
When using mini-cross with command invocation, a machine has always to be
specified. The machine determines where to look for the mini-cross
configuration and allows for multiple configurations in the same project. The
special machine _
is the default machine (most useful for shell invocation
though).
This command will start the referenced machine and execute the command using the default docker entry point (most likely a bash shell).
When using mini-cross in a CI, it might be benefitial to pass --no-tty
as
option in order to not require a pty.
Shell invocation
mini-cross [<machine>]
Invoking mini-cross without additional commands is referred to as shell invocation because the development environment will stay attached to the current shell. Multiple commands may now be executed inside the same container, which can be quit using the exit command (assuming the container uses a shell like bash as docker entry point).
Since the shell invocation does not use arguments, the machine name can be
omited and _
(the default machine) will be assumed.