Comments (19)
from vessel.
@fideloper ....My BAD! :-/
I guess I read you saying "check it out" and figured it may have been partially released!
I'm still very much looking forward to playing with this but will wait for an official release!
👍
from vessel.
from vessel.
@fideloper What do you think about passing current UID
and GID
to Dockerfile through Vessel
script file.
Dockerfile
# Set permissions
ARG PUID=33
ARG PGID=33
RUN groupmod -g $PGID www-data \
&& usermod -u $PUID www-data
RUN chown -R www-data:www-data /var/www
RUN chmod 755 /var/www
Vessel file
export PUID=$(id -u `whoami`)
export PGID=$(id -g `whoami`)
# Users of the docker containers
DOCKER_USER_APP="www-data"
Now we can pass the users to the compose command.
$COMPOSE run --user="$DOCKER_USER_APP" --rm $TTY \
-w /var/www/html \
app \
composer "$@"
from vessel.
Hi @lkmadushan - thanks!
I'm currently doing that for the Node container, although I haven't finished testing it, but I think that will get us where we need to be.
I'm doing similar for the app
container, however I'm not doing that at build-time with the Dockerfile
, but instead I'm doing it when the container spins up dynamically.
See the commits on the https://github.com/shipping-docker/vessel/tree/linuxperms branch to see more.
I may make this consistent to do the same way on each (Node and App images/containers). The only thing I don't like about the Dockerfile is the UID/GID gets hard-coded. However that's probably not an issue for more people using this on their dev machine. So, I think we'll likely end up going with your suggestion, but I want to play with it more to make sure it's a solid way to go about it.
Thanks again!
from vessel.
@fideloper you're welcome.
I like the idea of changing the user when the container spins up. need to check that out :)
Really enjoyed your shipping docker course and learned a lot from it. I was waiting for another episode that contains using docker in production with rancheros
.
Thank you very much for sharing knowledge with others.
FYI: I had an issue when I'm using current user's UID/GID of host machine to fix linux permission, it's already allocated for an another application in the container.
from vessel.
PR #3 should settle this.
from vessel.
PR #3 should settle this.
This fixes this problem when php-fpm generates the file, but when you to vessel art make:...
or an artisan command generates the log file, it still gets permission problems, right?
I think it still needs what you did on node regarding to UID.
from vessel.
from vessel.
I just installed vessel and have this problem from the first run, also it's not mapping ports to localhost (Mac Os).
from vessel.
@vedmant The latest release should resolve that, however you'll need to rebuild your images if you previously installed Vessel.
Also, the docs say what is likely happening on localhost, but I won't know without you letting us know what error output you get, if any. You likely have the EADDRINUSE issue: https://vessel.shippingdocker.com/docs/common-issues/#eaddrinuse
from vessel.
@vedmant and @fideloper, I haven't seen this issue since the latest update, as Chris said. I have been using it non-stop since updating and rebuilding the boxes. It's a beautiful project!
from vessel.
Composer installed version "1.1.3", that's latest, according to releases list. No, I don't have any EADDRINUSE issues, it's not important, I open my app on "http://192.168.99.100/". Just tried to delete and reinstall everything, according to instructions, have the same error: "The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied".
from vessel.
Gotcha - Any reason not to use localhost
? Sounds like if that doesn't work, something else might be going on (perhaps localhost
is changed to something else in your /etc/hosts
file, or maybe localhost
is bound to port 80 but your 192...* network is not).
I've never had a permission issue in MacOS, Docker for Mac tends to make that Just Work™ since it works within a virtualized layer. Something on your system is different but I'm not sure what. Note that the version of Docker will matter more than the version of Docker-Compose.
Here's what I'm using:
Head to About Docker in this menu:
And see if perhaps you're on an older version of Docker?
from vessel.
@vedmant should also note that if you're not using Docker for Mac, and are instead using something like Docker Toolbox (running Docker within a virtualbox vm), then you'll run into errors like this, as the user ID it's attempting to run commands as may not match up to the user owning the files within the virtualbox VM. Vessel just won't work properly using Docker Toolbox (or while running Docker through a VM and using docker-machine to control it).
from vessel.
Thanks a lot, I think I installed docker somehow differently, yes, it's running on my Virtualbox and instead of Docker.app I have folder "Docker" in Applications with "Docker Quickstart Terminal" and "Kitematic (Beta)". I'll reinstall Docker completely.
from vessel.
Ah ha, that'll definitely do it! The "Docker for Mac" installer is a newer way they have to install it that should work better overall if you're able to try it out! https://docs.docker.com/docker-for-mac/install/
from vessel.
我也遇到类似的问题!不过我的做法是根据将容器内部和外部的www-data用户和组的id改为一致,然后容器以www-data的身份运行。这时挂载就没有问题了啊!这是我自己做的php镜像,希望对遇到同样问题的朋友有帮助。
Google translate:
I have also experienced similar problems! But my approach is consistent with changed according to the id www-data users and groups inside and outside of the container, the container then run as the www-data. Then mount no problem ah! This is my own doing php mirror , I hope to help friends encountered the same problem.
from vessel.
Ok, I'm also having this issue and yes, I'm running vessel through docker-machine. Any advice on what to do?
from vessel.
Related Issues (20)
- 403 Forbidden after installing vessel HOT 3
- US Locales are not supported HOT 1
- Change node version ? HOT 2
- Sqlite support? HOT 3
- Publish application logs to docker HOT 3
- Feature Request: Integrate Mutagen for better I/O on MacOs HOT 1
- Ability to disable installing predis HOT 1
- How to make subdomains work HOT 1
- Moving to production images HOT 2
- Slow development cycle HOT 1
- Vue Hot Reload HOT 1
- Clockwork debugger blank because of expires.conf HOT 4
- vessel art make:something always hangs for a while before returning HOT 1
- How to set MySQL root password HOT 3
- PHP 8 Support HOT 6
- failed to build HOT 2
- Laravel 7 error "Please make sure the PHP Redis extension is installed and enabled." HOT 2
- You need to install the imagick extension to use this back end HOT 1
- chown: invalid user: ‘user:user’ HOT 1
- Ambiguous ERROR: Unable to find 'docker' HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vessel.