mirror of
				https://github.com/docker/compose.git
				synced 2025-10-31 11:14:02 +01:00 
			
		
		
		
	pass COMPOSE_PROJECT_NAME env var in container mode
Avoids the surprise of finding the project name set to the directory name when COMPOSE_PROJECT_NAME is being used. Signed-off-by: Santiago M. Mola <santi@mola.io>
This commit is contained in:
		
							parent
							
								
									c17ef995b4
								
							
						
					
					
						commit
						0ea51906cd
					
				| @ -38,6 +38,9 @@ if [ -n "$COMPOSE_FILE" ]; then | |||||||
|     COMPOSE_OPTIONS="$COMPOSE_OPTIONS -e COMPOSE_FILE=$COMPOSE_FILE" |     COMPOSE_OPTIONS="$COMPOSE_OPTIONS -e COMPOSE_FILE=$COMPOSE_FILE" | ||||||
|     compose_dir=$(realpath "$(dirname "$COMPOSE_FILE")") |     compose_dir=$(realpath "$(dirname "$COMPOSE_FILE")") | ||||||
| fi | fi | ||||||
|  | if [ -n "$COMPOSE_PROJECT_NAME" ]; then | ||||||
|  |     COMPOSE_OPTIONS="-e COMPOSE_PROJECT_NAME $COMPOSE_OPTIONS" | ||||||
|  | fi | ||||||
| # TODO: also check --file argument | # TODO: also check --file argument | ||||||
| if [ -n "$compose_dir" ]; then | if [ -n "$compose_dir" ]; then | ||||||
|     VOLUMES="$VOLUMES -v $compose_dir:$compose_dir" |     VOLUMES="$VOLUMES -v $compose_dir:$compose_dir" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user