DEV Community

Discussion on: HarperDB Containerization Journey

Collapse
 
pratikjagrut profile image
Pratik Jagrut • Edited

Hi,
Still getting same error:

~
❯ mkdir /tmp/hdb_data/

~
❯ docker run -v /tmp/hdb_data/:/opt/harperdb/hdb -p 9925:9925 harperdb/hdb:latest
starting container.
ls: can't open '/opt/harperdb/hdb/': Permission denied
There is not an existing install. Initializing data directory.
rsync: recv_generator: mkdir "/opt/harperdb/hdb/backup" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/opt/harperdb/hdb/clustering" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/opt/harperdb/hdb/config" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/opt/harperdb/hdb/doc" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/opt/harperdb/hdb/keys" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/opt/harperdb/hdb/log" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/opt/harperdb/hdb/schema" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/opt/harperdb/hdb/transactions" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/opt/harperdb/hdb/trash" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1189) [sender=3.1.3]
Settings files not found, starting install process.
Terms & Conditions can be found at https://harperdb.io/legal/end-user-license-agreement
and can be viewed by typing or copying and pasting the URL into your web browser.
[TC_AGREEMENT] I Agree to the HarperDB Terms and Conditions. (yes/no):  Running HarperDB
Settings files not found, starting install process.
Terms & Conditions can be found at https://harperdb.io/legal/end-user-license-agreement
and can be viewed by typing or copying and pasting the URL into your web browser.
[TC_AGREEMENT] I Agree to the HarperDB Terms and Conditions. (yes/no):  
~ 2s
Enter fullscreen mode Exit fullscreen mode

But if I don't provide -v option it runs:

~
❯ docker run -p 9925:9925 harperdb/hdb:latest
starting container.
There is not an existing install. Initializing data directory.
Checking Transaction Environments exist
Finished checking Transaction Environments exist
   .
   .
   .
|------------- HarperDB 3.0.0 successfully started ------------|
Enter fullscreen mode Exit fullscreen mode

Maybe there is some issue with mounting directories.

Thread Thread
 
zaxharperdb profile image
Zachary Fowler

Howdy.
I imagined first thing this was a permissions issue, however I was able to reproduce with just the /..
None the less!
Because the user in the Container is not root, it has a user id of 1000
Iff you are running docker commands as root the container does not have permissions to write to any directory on the host system.
Therefore, you need to run docker and create directories for the host system with a non root user.
It is considered a security risk to use the root user inside the container.
The container is built from node:12.16-alpine and they supply a non root user named node.
Let me know if I can provide any other insight.
Happy to help,
Zachary.

Thread Thread
 
pratikjagrut profile image
Pratik Jagrut

Oh, okay, then maybe I'll use podman to run it(rootless container).

Thread Thread
 
pratikjagrut profile image
Pratik Jagrut

Even with the podman I'm seeing same error. Now podman ensures rootless container. This problem only occurs when I try to use -v.