79360629

Date: 2025-01-16 07:06:45
Score: 1.5
Natty:
Report link

Thanks to the point provided by @David Maze, the problem is this image use a default user sqlite with user and group id as:

root@b8316:/home/guest/programfiles/docker# docker run --rm -it keinos/sqlite3 /bin/sh
/ $ id
uid=101(sqlite) gid=102(sqlite) groups=102(sqlite)

while the host mounted dir has user and group id 1000, therefore, changing the user and group id of container user is the right way:

root@b8316:/home/guest/programfiles/docker# docker run --rm -it --user 1000:1000 -v "/home/guest/workspace:/workspace" -w /workspace keinos/sqlite3
SQLite version 3.47.2 2024-12-07 20:39:59
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open sample.db
sqlite> CREATE TABLE table_sample(timestamp TEXT, description TEXT);
sqlite> INSERT INTO table_sample VALUES(datetime('now'),'First sample data. Foo');
sqlite> INSERT INTO table_sample VALUES(datetime('now'),'Second sample data. Bar');
sqlite> .table
table_sample
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @David
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: PuppyCat