Last active
October 29, 2022 20:14
-
-
Save sephraim/ee6e7c5b31baac879fd8d7de55e7e806 to your computer and use it in GitHub Desktop.
[Quickly run command inside Docker container] Create a temporary container from your docker-compose.yml setup and run a command in it. #docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example 1 | |
docker compose run --entrypoint 'bash -c' --rm web 'bundle exec rails {db:create,db:migrate}' | |
# Example 2 | |
docker compose run --no-deps --rm web bundle install && docker compose build | |
# Example 3 | |
docker compose run --no-deps --rm -e GEM_HOME=/home/ruby/gems <SERVICE_NAME> bundle install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment