Giter VIP home page Giter VIP logo

Comments (19)

fideloper avatar fideloper commented on July 24, 2024

from vessel.

faasie avatar faasie commented on July 24, 2024

@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.

fideloper avatar fideloper commented on July 24, 2024

from vessel.

lkmadushan avatar lkmadushan commented on July 24, 2024

@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.

fideloper avatar fideloper commented on July 24, 2024

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.

lkmadushan avatar lkmadushan commented on July 24, 2024

@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.

fideloper avatar fideloper commented on July 24, 2024

PR #3 should settle this.

from vessel.

dbpolito avatar dbpolito commented on July 24, 2024

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.

fideloper avatar fideloper commented on July 24, 2024

from vessel.

vedmant avatar vedmant commented on July 24, 2024

I just installed vessel and have this problem from the first run, also it's not mapping ports to localhost (Mac Os).

from vessel.

fideloper avatar fideloper commented on July 24, 2024

@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.

faasie avatar faasie commented on July 24, 2024

@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.

vedmant avatar vedmant commented on July 24, 2024

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.

fideloper avatar fideloper commented on July 24, 2024

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:

image

And see if perhaps you're on an older version of Docker?

image

from vessel.

fideloper avatar fideloper commented on July 24, 2024

@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.

vedmant avatar vedmant commented on July 24, 2024

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.

fideloper avatar fideloper commented on July 24, 2024

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.

farmercode avatar farmercode commented on July 24, 2024

我也遇到类似的问题!不过我的做法是根据将容器内部和外部的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.

colynb avatar colynb commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.