Sign inSign up

raohuaming/gitlab-rancher-cli

By raohuaming

•Updated about 9 years ago

rancher-cli for gitlab-ci

Image
0

1.3K

raohuaming/gitlab-rancher-cli repository overview

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

Tag summary

Content type

Image

Digest

Size

7.2 MB

Last updated

about 9 years ago

docker pull raohuaming/gitlab-rancher-cli