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

Make sure file permissions are set correctly in docker #970

Open
tenmoves opened this issue Apr 4, 2023 · 0 comments
Open

Make sure file permissions are set correctly in docker #970

tenmoves opened this issue Apr 4, 2023 · 0 comments
Assignees
Labels
feature New feature request Governance About On-Chain governance

Comments

@tenmoves
Copy link
Contributor

tenmoves commented Apr 4, 2023

Is your feature request related to a problem?

After the validation workflow is completed the validator container will collect metrics from prometheus container, we create metrics file from the container in /opt/data/metrics which is in turn mounted in disk.

After the pipeline of CD is completed we want to clean dumped files from the user disk however the permission on metrics file aren't set correctly because we are using root user in all our containers.

Describe the solution you'd like

one possible solution is to set a non root user by adding 2 arguments to dockerfile USER_ID and USERGROUP_ID which are extracted from the current user terminal session.

in docker file for a user named archethic_node and a group named archethic

ARG USER_ID ARG GROUP_ID RUN addgroup -g $GROUP_ID archethic && \ adduser --shell /sbin/nologin --disabled-password \ --uid $USER_ID --ingroup archethic archethic_node

and then

USER archethic_node

when building image
{user_id, _} = System.cmd("id", ["-u"])

{group_id, _} = System.cmd("id", ["-g"])

{_, 0} = docker([ "build", "-t", "archethic-ci", "--target", "archethic-ci", "--build-arg", "USER_ID=#{String.trim(user_id)}", "--build-arg", "GROUP_ID=#{String.trim(group_id)}", "." ])

however when changing user we have a git dubious ownership error when trying to create a new branch for code proposal.

Additional context

Epic: #154

@tenmoves tenmoves added feature New feature request Governance About On-Chain governance labels Apr 4, 2023
@tenmoves tenmoves self-assigned this Apr 6, 2023
@samuelmanzanera samuelmanzanera added this to the OnChain governance milestone May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request Governance About On-Chain governance
Projects
Status: Review 💬
Development

Successfully merging a pull request may close this issue.

2 participants