Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROJECT_NAME="gameofthrones"
- CURRENT_DOCKER_COMPOSE_VERSION=$( docker-compose -v | grep -o '[0-9]*[.][0-9]*[.][0-9]' | sed -e 's/[.]//g' )
- BREAKING_DOCKER_COMPOSE_VERSION=1210
- # Since docker compose version: '1.21.0', the network setup automatically adds a single '_' to the project_name,
- # while version '1.20.0' and below replaces any extra ‘_’ at the end of the project_name with a single '_'.
- # This assumes that at versions below '1.20.0' e.g. '1.9.0', no ‘_’ is added at the end of the project_name.
- if [[ ${CURRENT_DOCKER_COMPOSE_VERSION} -lt ${BREAKING_DOCKER_COMPOSE_VERSION} ]]; then
- PROJECT_NAME="${PROJECT_NAME}_"
- fi
- echo " ----- Project name prefix is: ${PROJECT_NAME} -----"
- docker-compose -p ${PROJECT_NAME} up -d
Add Comment
Please, Sign In to add comment