Skip to content

Commit

Permalink
Fix command not found in helper scripts (#196)
Browse files Browse the repository at this point in the history
The functionally previously provided by docker-compose has been baked
into the docker CLI and docker-compose is no longer shipped with the
Docker for Desktop application bundle.

When running this project's helper scripts on recent version of docker /
Docker for Desktop the docker-compose command is not found:

```
$ bin/bootstrap
bin/cleanup: line 3: docker-compose: command not found
bin/bootstrap: line 4: docker-compose: command not found
```
  • Loading branch information
indiebrain authored Dec 31, 2024
1 parent 238c6d7 commit f3048d8
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
1. [OSX](#org5118f49)
2. [Debian/Ubuntu Linux](#org7168fc9)
2. [Getting Started](#org76343d4)
3. [Working with Rails and `docker-compose`](#org23b1de9)
3. [Working with Rails and `docker compose`](#org23b1de9)
1. [Bootstrapping the application](#org52fd95d)
2. [Installing application dependencies](#orge7ed08d)
3. [Obtaining a shell](#org422384f)
Expand Down Expand Up @@ -55,14 +55,14 @@ Via [homebrew](https://brew.sh/)

<a id="org23b1de9"></a>

# Working with Rails and `docker-compose`
# Working with Rails and `docker compose`

All of the dependencies to build and run the rails application are
included in the `web` service's image - named
`power-web-development-interview_web`. To run typical `bin/rails`
commands inside the container use the general form:

docker-compose run --rm web bash -lc "<rails-command>"
docker compose run --rm web bash -lc "<rails-command>"

We've provided binstubs for common tasks as a convenience:

Expand Down
2 changes: 1 addition & 1 deletion bin/bootstrap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh

bin/cleanup
docker-compose run --rm web bash -lc "bin/setup"
docker compose run --rm web bash -lc "bin/setup"
2 changes: 1 addition & 1 deletion bin/cleanup
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh

docker-compose down --rmi=all --volumes
docker compose down --rmi=all --volumes
2 changes: 1 addition & 1 deletion bin/console
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh

docker-compose run --rm web bash -lc "bin/rails console"
docker compose run --rm web bash -lc "bin/rails console"
2 changes: 1 addition & 1 deletion bin/deps
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh

docker-compose run --rm web bash -lc "(bin/bundle check || bin/bundle install) && (bin/yarn check || bin/yarn install)"
docker compose run --rm web bash -lc "(bin/bundle check || bin/bundle install) && (bin/yarn check || bin/yarn install)"
2 changes: 1 addition & 1 deletion bin/shell
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh

docker-compose run --rm web bash -l
docker compose run --rm web bash -l
2 changes: 1 addition & 1 deletion bin/start
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh

docker-compose up web
docker compose up web
2 changes: 1 addition & 1 deletion bin/stop
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh

docker-compose stop
docker compose stop

0 comments on commit f3048d8

Please sign in to comment.