1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00
dragonflydb-dragonfly/tools
Roman Gershman cec3659b51
fix: named volume permissions in docker (#3518)
Fixes #2917

The problem is described in this "working as intended" issue https://github.com/moby/moby/issues/3124
So the advised approach of using "USER dfly" directive does not really work because it requires
that the host will also define 'dfly' user with the same id. It's unrealistic expectation.

Therefore, we revert the fix done in #1775 and follow valkey approach:
https://github.com/valkey-io/valkey-container/blob/mainline/docker-entrypoint.sh#L12

1. we run the entrypoint in the container as root which later spawns the dragonfly process
2. if we run as root:
   a. we chmod files under /data to dfly.
   b. use setpriv to exec ourselves as dfly.
3. if we do not run as root we execute the docker command.

So even though the process starts as root, the server runs as dfly and only the bootstrap
part has elevated permissions is used to fix the volume access.

While we are at it, we also switched to setpriv following the change of https://github.com/valkey-io/valkey-container/pull/24/files

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-22 11:33:29 +03:00
..
benchmark refactor: set info_replication_valkey_compatible=true (#3467) 2024-08-08 21:42:58 +03:00
docker fix: named volume permissions in docker (#3518) 2024-08-22 11:33:29 +03:00
eviction feat(server): perform eviction upon memory pressure in cache mode (#2084) 2023-11-01 11:11:27 -07:00
local/monitoring chore: reduce pipelining latency by reusing existing shard fibers (#3494) 2024-08-14 14:45:54 +03:00
packaging fix: named volume permissions in docker (#3518) 2024-08-22 11:33:29 +03:00
replay chore(traffic loger): use pipelining and print/analyze commands (#3527) 2024-08-20 09:32:15 +03:00
balls_bins.py chore: add balls and bins simulator (#2001) 2023-10-11 01:18:29 +03:00
cache_logs_player.py Cache logs player batching (#623) 2022-12-30 12:29:11 +03:00
cache_testing.py fix: improvements to caching tool 2023-01-11 15:11:37 +02:00
cluster_mgr.py refactor: set info_replication_valkey_compatible=true (#3467) 2024-08-08 21:42:58 +03:00
defrag_db.py tools: Hash defrag script (#1723) 2023-08-22 09:11:34 +03:00
defrag_mem_test.py feat: add defragment command (#3003) 2024-05-08 14:26:42 +03:00
generate-tls-files.sh feat(server): Use mimalloc in SSL calls (#2710) 2024-03-11 08:25:59 +02:00
json_benchmark.py feat(server): JSON family using JSON type (#561) 2022-12-14 19:25:10 +02:00
release.sh fix: release pipeline (#2439) 2024-01-18 16:52:19 +02:00
requirements.txt chore(deps): bump redis from 4.3.4 to 4.4.4 in /tools (#1221) 2023-05-17 10:13:59 +03:00