Skip to content

Instantly share code, notes, and snippets.

@juliohm1978
Created December 12, 2019 04:37
Show Gist options
  • Save juliohm1978/e5c2f89e06529857114d151e516eade4 to your computer and use it in GitHub Desktop.
Save juliohm1978/e5c2f89e06529857114d151e516eade4 to your computer and use it in GitHub Desktop.
version: '3'

services:
  a:
    image: ubuntu
    command: sleep 999

  b:
    image: ubuntu
    command: echo hello
    depends_on:
      - a
$ docker-compose up --exit-code-from b; echo $?
WARNING: using --exit-code-from implies --abort-on-container-exit
Starting tmp_a_1 ... done
Starting tmp_b_1 ... done
Attaching to tmp_a_1, tmp_b_1
b_1  | hello
tmp_b_1 exited with code 0
Aborting on container exit...
Stopping tmp_a_1 ... done
0```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment