Guest User

Untitled

a guest
Jun 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. PROJECT_NAME="gameofthrones"
  2.  
  3. CURRENT_DOCKER_COMPOSE_VERSION=$( docker-compose -v | grep -o '[0-9]*[.][0-9]*[.][0-9]' | sed -e 's/[.]//g' )
  4. BREAKING_DOCKER_COMPOSE_VERSION=1210
  5.  
  6. # Since docker compose version: '1.21.0', the network setup automatically adds a single '_' to the project_name,
  7. # while version '1.20.0' and below replaces any extra ‘_’ at the end of the project_name with a single '_'.
  8. # This assumes that at versions below '1.20.0' e.g. '1.9.0', no ‘_’ is added at the end of the project_name.
  9. if [[ ${CURRENT_DOCKER_COMPOSE_VERSION} -lt ${BREAKING_DOCKER_COMPOSE_VERSION} ]]; then
  10. PROJECT_NAME="${PROJECT_NAME}_"
  11. fi
  12.  
  13. echo " ----- Project name prefix is: ${PROJECT_NAME} -----"
  14.  
  15. docker-compose -p ${PROJECT_NAME} up -d
Add Comment
Please, Sign In to add comment