Skip to content

Latest commit

 

History

History
49 lines (29 loc) · 1.91 KB

README.md

File metadata and controls

49 lines (29 loc) · 1.91 KB

rancher-cli

This Dockerfile builds a docker image based on rancher/cli, with an overridden ENTRYPOINT to handle custom CMDs. Useful when using, for instance, gitlab-ci, or any other CI/CD tool providing job scripts to be run inside the container.

See the repo on Docker Hub.

NOTE: This repository is extracted from badouralix/dockerfiles.

Usage

CLI usage

Assuming envvars RANCHER_URL, RANCHER_ACCESS_KEY and RANCHER_SECRET_KEY are set:

docker run --rm -e RANCHER_URL=$RANCHER_URL -e RANCHER_ACCESS_KEY=$RANCHER_ACCESS_KEY -e RANCHER_SECRET_KEY=$RANCHER_SECRET_KEY badouralix/rancher-cli rancher ps

If rancher command is not an alpine command, rancher can be omitted within the previous command.

GitLab-CI

Assuming secret variables RANCHER_URL, RANCHER_ACCESS_KEY and RANCHER_SECRET_KEY are set in your CI/CD pipelines settings, image can be use as follow, to restart a service for instance:

image: badouralix/rancher-cli

script:
  - rancher --wait restart stack/service

Warning

When using it in command line, this image is known to be buggy with several built-in commands such as help... The safest way to use this image is to always append rancher before any rancher-cli command, thus to prevent any error.

License

All contents licensed under the WTFPL