|
| 1 | +# deployx |
| 2 | + |
| 3 | +[](https://pkg.go.dev/github.com/aaraney/deployx) |
| 4 | + |
| 5 | +`deployx` is a Docker CLI plugin rewrite of `docker stack deploy` that is compliant |
| 6 | +with [compose-spec](https://github.com/compose-spec/compose-spec). |
| 7 | + |
| 8 | +## Features |
| 9 | + |
| 10 | +- Compose file variable expansion (done by default) |
| 11 | +- Support for one or more alternate `.env` files |
| 12 | + |
| 13 | +## Installing |
| 14 | + |
| 15 | +### Building from source |
| 16 | + |
| 17 | +Building from source requires go and make be installed. Install go using either your package manager |
| 18 | +of choice (i.e. `brew`) or by following [these instructions](https://go.dev/doc/install). |
| 19 | + |
| 20 | +```shell |
| 21 | +# clone repo |
| 22 | +git clone https://github.com/aaraney/deployx.git && cd deployx |
| 23 | + |
| 24 | +make build && make install |
| 25 | + |
| 26 | +# uninstall |
| 27 | +# make uninstall |
| 28 | +``` |
| 29 | + |
| 30 | +Note, the instructions above install `deployx` for a single user. To install globally run `make build` |
| 31 | +and copy the `docker-deployx` binary from the `./build` directory to one of the following locations: |
| 32 | + |
| 33 | +- `/usr/local/lib/docker/cli-plugins` OR `/usr/local/libexec/docker/cli-plugins` |
| 34 | +- `/usr/lib/docker/cli-plugins` OR `/usr/libexec/docker/cli-plugins` |
| 35 | + |
| 36 | +### Dockerfile |
| 37 | + |
| 38 | +The easiest way to get started it using a pre-built docker image and `deployx` in standalone mode. |
| 39 | +The following snippet shows pulling and running `deployx`. Adjust the volume mount accordingly to |
| 40 | +mount your compose and env files. |
| 41 | + |
| 42 | +```shell |
| 43 | +docker run -it --rm --volume $(pwd):/home --volume /var/run/docker.sock:/var/run/docker.sock aaraney/docker-deployx |
| 44 | +docker-deployx --compose-file /home/<compose.yaml> mystack |
| 45 | +``` |
| 46 | + |
| 47 | +## Usage |
| 48 | + |
| 49 | +Use `deployx` just as you would `docker stack deploy` by instead calling `docker deployx`. Unlike |
| 50 | +`docker stack deploy`, environment and `.env` variables are interpolated into compose files. So, |
| 51 | +there is no longer a need to: `docker stack deploy -c <(docker-compose config) stack-name`. |
| 52 | + |
| 53 | +```shell |
| 54 | +$ docker deployx |
| 55 | +Usage: docker deployx [OPTIONS] STACK |
| 56 | + |
| 57 | +Deploy a new stack or update an existing stack |
| 58 | + |
| 59 | +Options: |
| 60 | + -c, --compose-file strings Path to a Compose file, or "-" to read from stdin |
| 61 | + --env-file strings Path to an alternative env file, or "-" to read from stdin |
| 62 | + --no-interpolate Don't perform environment variable interpolation |
| 63 | + --prune Prune services that are no longer referenced |
| 64 | + --resolve-image string Query the registry to resolve image digest and supported platforms ("always", "changed", "never") (default "always") |
| 65 | + --with-registry-auth Send registry authentication details to Swarm agents |
| 66 | +``` |
0 commit comments