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

fix: permission denied in the docker image #4464

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nodece
Copy link
Member

@nodece nodece commented Jul 15, 2024

Fix #4461

Motivation

$BK_USER has been added to the image, we should use this user to run the image.

You can try this command to verify this PR.

gh pr checkout 4464
cd docker
docker build -t zixuan/bk .
docker run -it --rm zixuan/bk

Changes

  • Use $BK_USER with the group root to run the image.
  • Follow up "Principle of least privilege".
  • Add ZK_SHELL_HOME to set the zk-shell home to writing .zk-shell file to BK_HOME/data, not BK_HOME.

@nodece
Copy link
Member Author

nodece commented Jul 15, 2024

Could you help to review this PR? @shoothzj

Copy link
Member

@StevenLuMT StevenLuMT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nodece
Copy link
Member Author

nodece commented Jul 24, 2024

Bump

docker/Dockerfile Outdated Show resolved Hide resolved
@nodece nodece requested a review from lhotari July 29, 2024 07:13
@shoothzj
Copy link
Member

@lhotari Would you please take a look again?

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not great that /opt/bookkeeper is required to be writable, but that issue could be handled separately.

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the build should be a multi-staged one. Otherwise chmod/chown operations could increase the resulting image size significantly because changing the ownership or access bits makes a copy of the file.

docker/Dockerfile Outdated Show resolved Hide resolved
@nodece
Copy link
Member Author

nodece commented Aug 22, 2024

@lhotari Your review result has been fixed.

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good work!

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.

Permission denied in the docker image
4 participants