Skip to content

Ease file permission issues on Linux by injecting UID/GID #3

Description

@jeffgeorge

Hi @EvanDarwin, thanks so much for doing the groundwork to get a replacement for Bitnami's docker images.

I had a great time building out a migration plan from Bitnami to your image, and it worked perfectly on MacOS, but when I moved it to my eventual production linux server I hit a bunch of issues with file ownership.

Upon digging further, I found you're manually creating a phpbb user and group (receiving UID=100 and GID=101), which is understandably freaking out on my host if I try to set up any volumes in the /opt/phpbb directory tree.

I don't know the best way to do this, but I have a proof of concept here. It's very ugly, because I have to pass the parameters through build.sh -> Dockerfile because the phpbb user is created in the Dockerfile.

I've seen other Docker containers that expose environment variables for UID/GID as Compose environment variables. I don't particularly care how it's implemented, I'd just love to be able to add like:

    environment:
      - PUID=1001
      - PGID=1001

And end up with those settings, and get the defaults if you don't pass vars. . . but I think that would require a larger refactor, such that the user is created outside of the image build process.

Alternatively, it looks like there's some kind of way to do this without explicitly creating a user, by using the user directive.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions