-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --build
and --no-build
options to run
analogous to up
command.
#3448
Comments
Can't you just run |
No, because it will build every single thing in the |
|
I know how it works. But I want If |
Exactly, the "run I'm open to either requiring |
Why was this issue closed without a comment? I would find |
Hey there, I also came looking for something like this for builds with |
@ulyssessouza Could you re-open this? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it had not recent activity during the stale period. |
Please reopen |
This is exactly what bugs me at the moment too. |
Can we please re-open this ? |
Same here. My workaround: Check for an existing docker image and, if necessary, build it with the right arguments before calling # Assuming project 'my_project' and service 'app'
if ! docker inspect --type=image my_project_app:latest > /dev/null 2>&1
then
echo "Couldn't find image for 'app'. Going to build it first."
docker-compose build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -u) app
# Or put any other logic you would execute in the --no-build case here.
fi
# Now we can call `run` with a properly built image
docker-compose run --no-deps --rm app run-tests-or-whatever.sh |
Also it is usefull when you have image in registry but don't have locally - it rather builds than pull image, which is not what I want. eg. services:
asdf:
image: my-registry.com/my-image:my-tag
build: . docker-compose run --rm asdf # slowly builds image instead of fast pull |
This is exactly what's tripping me up too. Really need a |
As a workaround you can use docker compose pull before docker compose run, as soon as necessary images are present locally, compose doesn't build images. |
docker-compose up --help
outputs:But these options are missing from
docker-compose run --help
.As of
docker-compose version 1.7.1, build unknown
from Pip.The text was updated successfully, but these errors were encountered: