Skip to content

raohuaming/gitlab-rancher-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Dockerfiles everywhere 🐳

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%