This Dockerfile builds a docker image based on rancher/cli, with an overridden
ENTRYPOINT
to handle custom CMD
s. 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.
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.
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
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.
All contents licensed under the WTFPL