Skip to content

Instantly share code, notes, and snippets.

@xeoncross
Created April 30, 2020 21:38
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 xeoncross/bab3f9081c8726ec984b85f8c0c54efd to your computer and use it in GitHub Desktop.
Save xeoncross/bab3f9081c8726ec984b85f8c0c54efd to your computer and use it in GitHub Desktop.
Be careful when setting docker compose environment variables

The following shows the right and wrong way to specify the environment flags. Be careful using Key: Value format depending on the docker version.

version: "3.2"
services:
    mariadb:
        image: mariadb:10.5
        ports:
            - "3306:3306"
        environment:
            # MYSQL_ROOT_PASSWORD: admin
            # MYSQL_DATABASE: app
            # MYSQL_USER: app
            # MYSQL_PASSWORD: password
            
            - MYSQL_ROOT_PASSWORD=admin
            - MYSQL_DATABASE=app
            - MYSQL_USER=app
            - MYSQL_PASSWORD=password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment