Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:ALP:Workloads
grafana-container
grafana-container-manage.sh
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File grafana-container-manage.sh of Package grafana-container
#!/bin/bash # quick script to manage the container if [ -f /etc/grafana-functions ] ; then . /etc/grafana-functions elif [ -f `pwd`/grafana-functions ]; then echo "Found local version of grafana-functions" export CONF="`pwd`/grafana-container.conf" . "`pwd`/grafana-functions" else echo "! need /etc/grafana-functions; Exiting"; exit 1 fi check_load_config_file create_container() { podman create \ --name ${CONTAINER_NAME} \ --publish 3000:3000/tcp \ --publish 16022:16022/tcp \ ${IMAGE} } run_container() { podman run \ --name ${CONTAINER_NAME} \ --rm -ti \ --publish 3000:3000/tcp \ --publish 16022:16022/tcp \ --entrypoint bash \ ${IMAGE} } if [ -z "$1" ]; then echo " First ARG is mandatory: $0 [create|start|stop|rm|rmcache|run|bash|logs|install|uninstall] CONTAINER_NAME: '${CONTAINER_NAME}' DEPLOYMENT: create Pull the image and create the container automatically install install needed files on the host to manage '${CONTAINER_NAME}' container (in /usr/local/bin and /etc) start Start the container '${CONTAINER_NAME}' REMOVAL: uninstall uninstall all needed files on the host to manage '${CONTAINER_NAME}' container stop stop the container '${CONTAINER_NAME}' rm delete the container '${CONTAINER_NAME}' rmcache remove the container image in cache ${IMAGE} DEBUG: run podman run container '${CONTAINER_NAME}' bash go with /bin/bash command inside '${CONTAINER_NAME}' logs see log of container '${CONTAINER_NAME}' " exit 1 fi ########### # MAIN ########### set -euxo pipefail case $1 in start) podman start ${CONTAINER_NAME} podman ps | grep ${CONTAINER_NAME} ;; stop) podman stop ${CONTAINER_NAME} podman ps | grep ${CONTAINER_NAME} ;; rm) set +e podman stop ${CONTAINER_NAME} podman rm ${CONTAINER_NAME} ;; create) create_container ;; run) run_container ;; rmcache) podman rmi ${IMAGE} ;; logs) podman logs ${CONTAINER_NAME} ;; bash) set +e podman exec -ti ${CONTAINER_NAME} $@ ;; install) podman run --env IMAGE=${IMAGE} --rm --privileged -v /:/host ${IMAGE} /bin/bash /container/label-install ;; uninstall) podman run --env IMAGE=${IMAGE} --rm --privileged -v /:/host ${IMAGE} /bin/bash /container/label-uninstall ;; esac
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor