Sign inSign up

badouralix/rancher-cli

By badouralix

•Updated about 2 months ago

rancher-cli for gitlab-ci

Image
4

100K+

badouralix/rancher-cli repository overview

⁠rancher-cli

Docker Pulls Docker Stars Docker Image Version (latest by date) Docker Image Size (latest by date)

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⁠.

⁠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

Unless expressly stated otherwise, all contents licensed under the MIT License⁠.

Tag summary

Content type

Image

Digest

sha256:5eb4a1454…

Size

63.2 MB

Last updated

about 2 months ago

docker pull badouralix/rancher-cli