Skip to content

Instantly share code, notes, and snippets.

@barseghyanartur
Last active February 3, 2021 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barseghyanartur/b81d480161e5753d14e9c2271a731ed6 to your computer and use it in GitHub Desktop.
Save barseghyanartur/b81d480161e5753d14e9c2271a731ed6 to your computer and use it in GitHub Desktop.
Docker/Podman agnostic shell scripts

Script example

#!/bin/bash
if ! command -v podman &> /dev/null
then
    echo "podman could not be found. Falling back to docker"
    shopt -s expand_aliases
    alias podman='docker'
    alias podman-compose='docker-compose'
fi

echo "Running manuscript screening pods"
podman-compose -f docker-compose.yml up --abort-on-container-exit "$@"
podman-compose -f docker-compose.yml down

Usage

./start.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment