Skip to content

Instantly share code, notes, and snippets.

@sempr
Created October 14, 2020 09:48
Show Gist options
  • Save sempr/83786fa618cf9d107228bbad98908e1d to your computer and use it in GitHub Desktop.
Save sempr/83786fa618cf9d107228bbad98908e1d to your computer and use it in GitHub Desktop.
docker-compose, extend
version: "3.8"
x-superenv:
&default-superenv
environment:
XX: 135
FOO: superenv-foo
command: echo $${XX} $${FOO}
services:
echo: &echo-base
container_name: echo
image: alpine:latest
restart: always
command:
- sh
- -c
- echo $$XX && tail -F /xxx.log
environment:
XX: 123
echo2:
<<: *echo-base
container_name: echo2
environment:
XX: 456
echo3:
<<: *echo-base
container_name: echo3
environment:
XX: 789
run1:
<<: *default-superenv
image: alpine:latest
run2:
<<: *default-superenv
image: alpine:latest
command:
- sh
- -c
- echo $$FOO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment