-
Notifications
You must be signed in to change notification settings - Fork 73
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
Are the paths still correct #21
Comments
Hi! So, this does still work! Either way is fine, as it doesn't matter where in the container we save the files - neither are out of date. Here's why: In the first example there, we're saying files on my host machine (Mac) at We then set the working directory to So, within the container, In the second example, we're sharing the contents within the The second example is more consistent with the I hope that makes sense! There's a lot of wrap your head around. It's sort of weird to think about containers as little processes were creating and destroying all the time - it's like when you realize that git branches are just pointers to a commit - they're cheap and easy to create and destroy. Analogously (I guess...might be a bad analogy), containers allow us to run one-off commands and the exit/destroy the container when done. We can decide to put the files anywhere we want within the container. Note that the containers we're spinning up here to run these one-off commands are not the same ones that run the application code for use in a browser (altho they are based off of the same image). We're just creating an additional container, running a job, and killing that container when done. Let me know if I can get into any detail there, I'm not 100% sure I'm clarifying the part you may be confused on. |
Note also that a simpler way to run these commands, where you can worry less about the file paths (altho you have to worry about little bit) is to use In that case: docker run -it --rm \
-v $(pwd)/application:/opt \
-w /opt \
--network=phpapp_appnet \
shippingdocker/php \
php artisan make:auth Would become: docker-compose run --rm \
-w /var/www/html \
php \
php artisan make:auth Where in:
|
Windows 10, Version 17.12.0-ce-win47 (15139), Compose 1.18.0 This case didn't work for me with |
https://shippingdocker.com/docker-in-development/up-and-running/ references the path /opt
but the docker_compose file https://github.com/shipping-docker/php-app/blob/master/docker-compose.yml references
/var/www/html
so when I change the example commands to that it then works?
are one of these out of date or am I just missing the obvious :) thanks
The text was updated successfully, but these errors were encountered: