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 Image enhancement and better CLI support. #1600

Closed
wants to merge 1 commit into from

Conversation

jorgecuesta
Copy link
Contributor

@jorgecuesta jorgecuesta commented Mar 6, 2024

Why?

A few Geo-Mesh users report to POKTscan about an issue with the new image after we adopt the one on the pokt-network/pocket-core repository on the latest RC.

They report that this image is using root as the user and is recommended to avoid that practice. There are a lot of blogs and documentation about this, here one of them from a well-known docker image user/company.

Also, we detected a few things that could be enhanced on both, entry point and docker context.

The problem with having a public image using root right now is that pocket binary generates folders and files that now belong to the root user, so they will need to modify those permissions to belong to the proper app user and group. To this, I added another optional entry point that could be used once to fix the permission issue and then start the container as before.

Here you can see how to use it with docker-compose or docker

Changes:

  • Modifications to Dockerfile allow the container to run as app user instead of root.
  • Added a new shell script named fix_permissions.sh to fix ownership issues related to running containers.
  • Updated Dockerfile to use this new script.
  • Added a .dockerignore file to help maintain a cleaner Docker build context, excluding unnecessary files.
  • Modifications to entrypoint.sh allows the user to run all its internal commands with the proper --datadir param. Now properly handle the start command when --keybase=false is sent. Also, allow the user to pass the --datadir as an env variable to omit it on the start command.

reviewpad:summary

…Entrypoint file to handle few edge cases.

Details:
*. Modifications to Dockerfile allow for the container to be run as app user instead of root.
*. Added a new shell script named fix_permissions.sh to fix ownership issues related to running containers.
*. Updated Dockerfile to use this new script.
*. Added a .dockerignore file to help maintain a cleaner Docker build context, excluding unnecessary files.
*. Modifications to entrypoint.sh allow user to run all the internal commands of it with the proper --datadir param. Now properly handle the start command when --keybase=false is sent. Also allow user to pass the --datadir as env variable to omit it on start command.
@Olshansk Olshansk added bug Something isn't working infrastructure labels Mar 6, 2024
@Olshansk Olshansk added this to the Network Quality of Life milestone Mar 7, 2024
@jorgecuesta jorgecuesta closed this Mar 8, 2024
@jorgecuesta jorgecuesta deleted the docker-image-fix branch March 8, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working infrastructure
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

None yet

2 participants