Skip to content

Conversation

@indiebrain
Copy link
Collaborator

@indiebrain indiebrain commented Sep 21, 2020

Before, any one-off container made by these make tasks hangs around in
an exited state after command execution is terminated - notice
development_app_run_e3b196b37f5d in the example below:

[maximilian: development] cleanup-one-off-development-containers *^ →
$ make rspec
docker-compose run app bin/rspec

...snip...

Finished in 36.48 seconds (files took 11.52 seconds to load)
286 examples, 0 failures, 177 pending

Randomized with seed 34516

[maximilian: development] cleanup-one-off-development-containers *^ →
$ docker-compose ps -a
              Name                            Command               State                 Ports
-------------------------------------------------------------------------------------------------------------
development_app_run_e3b196b37f5d   bin/rspec                        Exit 0
development_db_1                   docker-entrypoint.sh postgres    Up       5432/tcp
development_email_1                mailcatcher --foreground - ...   Up       1025/tcp, 0.0.0.0:1080->1080/tcp

After, one off containers delete themselves when the container
exits. Notice in the example below that the
development_app_run_<container-id> container is not present after execution:

[maximilian: development] cleanup-one-off-development-containers +^ →
$ make rspec
docker-compose run --rm app bin/rspec

...snip...

Finished in 38.43 seconds (files took 11.91 seconds to load)
286 examples, 0 failures, 177 pending

Randomized with seed 10269

[maximilian: development] cleanup-one-off-development-containers +^ →
$ docker-compose ps -a
       Name                      Command               State                Ports
-----------------------------------------------------------------------------------------------
development_db_1      docker-entrypoint.sh postgres    Up      5432/tcp
development_email_1   mailcatcher --foreground - ...   Up      1025/tcp, 0.0.0.0:1080->1080/tcp

Nice and tidy.

Before any one-off container made by these make tasks hangs around in
an exited state after command execution is terminated - notice
`development_app_run_e3b196b37f5d` in the example below:

```
[maximilian: development] cleanup-one-off-development-containers *^ →
$ make rspec
docker-compose run app bin/rspec

...snip...

[maximilian: development] cleanup-one-off-development-containers *^ →
$ docker-compose ps -a
              Name                            Command               State                 Ports
-------------------------------------------------------------------------------------------------------------
development_app_run_e3b196b37f5d   bin/rspec                        Exit 0
development_db_1                   docker-entrypoint.sh postgres    Up       5432/tcp
development_email_1                mailcatcher --foreground - ...   Up       1025/tcp, 0.0.0.0:1080->1080/tcp
```

After, one off containers delete themselves when the container
exits. Notice in the example below that the
`development_app_run_<container-id>` container is not present after execution:

```
[maximilian: development] cleanup-one-off-development-containers +^ →
$ make rspec
docker-compose run --rm app bin/rspec

...snip...

[maximilian: development] cleanup-one-off-development-containers +^ →
$ docker-compose ps -a
       Name                      Command               State                Ports
-----------------------------------------------------------------------------------------------
development_db_1      docker-entrypoint.sh postgres    Up      5432/tcp
development_email_1   mailcatcher --foreground - ...   Up      1025/tcp, 0.0.0.0:1080->1080/tcp
```

Nice and tidy.
@indiebrain indiebrain self-assigned this Sep 21, 2020
Copy link
Collaborator

@solebared solebared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, thanks for catching that!

@solebared solebared merged commit df39c6b into main Sep 21, 2020
@solebared solebared deleted the cleanup-one-off-development-containers branch September 21, 2020 19:55
@indiebrain
Copy link
Collaborator Author

Cheers, mate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants