Skip to content
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

docker: fix permission issues in Dockerfile #12975

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

dvdksn
Copy link
Contributor

@dvdksn dvdksn commented Oct 21, 2024

I think the --link option might've caused a permission issue for the non-root hugo user.

Related issues:

Also noticed that the /project workdir was created before we assumed the hugo:hugo user, which resulted in that directory being owned by root. I reordered the instructions to make sure /project is owned by the correct user.

@dvdksn dvdksn marked this pull request as ready for review October 21, 2024 07:52
@dvdksn
Copy link
Contributor Author

dvdksn commented Oct 21, 2024

@jmooring @bep could you try with this build? I ran the reproducer in the linked issue (on macos) and it seems to work for me.

mkdir -p $HOME/.cache/hugo_cache
git clone https://github.com/jmooring/hugo-docker-test
cd hugo-docker-test
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache -p 1313:1313 davidkarlsson416/hugo:12975 server --bind="0.0.0.0"

@dvdksn dvdksn changed the title docker: fix permission issue for /var/hugo by removing COPY --link docker: fix permission issues in Dockerfile Oct 21, 2024
@bep
Copy link
Member

bep commented Oct 21, 2024

Works for me.

@bep
Copy link
Member

bep commented Oct 21, 2024

@dvdksn could you get the commit message(s) in line with the guidelines?

The use of COPY --link incorrectly caused the /var/hugo directory to be
owned by root, and not the hugo:hugo user.

Signed-off-by: David Karlsson <[email protected]>
@dvdksn dvdksn force-pushed the fix-hugo-docker-permissions branch from fe7a5b8 to 5101a5d Compare October 21, 2024 09:56
@bep bep merged commit 88d598a into gohugoio:master Oct 21, 2024
6 checks passed
@dvdksn dvdksn deleted the fix-hugo-docker-permissions branch October 21, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants