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>
1. Move docker build files to separate dir from docker script files
so that they won't be part of build context. Update dockerignore as well
2. Fix lib dependencies for alpine
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Specifiying an exact boost version is not robust.
Also we do not depend on fibers anymore and boost-context is enough.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Alpine images don't have bash installed by default, so we need to use
`/bin/sh` instead. This follows the *same existing convention that
we follow in the `entrypoint.sh` script*.
Both ubuntu and alpine images have been tested (i.e healthchecks to
pass) to work with this change.
1. Align checked version with the format provided by the endpoint
2. Improve error reporting as well as install ca certificates in the docker file.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
- make use of docker buildx caching when possible (helpful with local docker builds)
- introduce a reusable container workflow which is triggered by docker-release and docker-weekly workflows
- added an alpine-dev Dockerfile
- split release.sh contents into different Makefile targets
- make use of job matrix to build alpine + ubuntu in parallel
- make alpine build optional by checking for Dockerfile presence
-- as the pre-built binaries don't work with alpine, because of glibc <-> musl incompatibilities
Signed-off-by: Philipp Born <git@pborn.eu>
1. Reads from external storage support now o_direct mode.
2. Simplify write unloading logic. Make pending buffer a ring buffer with
a predefined capacity.
3. Add more tiered stats to info command
1. Docker build now builds for arm64 as well.
2. Add bind option to specify on which interface the server should listen.
3. Automatically deduce maxmemory setting.