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

Add Valkey Container #11156

Draft
wants to merge 1 commit into
base: 3.0-dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .pipelines/containerSourceData/valkey/Dockerfile-Valkey
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

ARG BASE_IMAGE

FROM $BASE_IMAGE

@INCLUDE_MAIN_RUN_INSTRUCTION@

RUN set -eux && \
valkey-cli --version && \
valkey-server --version && \
mkdir /data && \
chown valkey:valkey /data

VOLUME /data
WORKDIR /data

COPY valkey-docker-entrypoint.sh /usr/local/bin/

RUN chmod +x /usr/local/bin/valkey-docker-entrypoint.sh

ENTRYPOINT ["/usr/local/bin/valkey-docker-entrypoint.sh"]

EXPOSE 6379
CMD ["valkey-server"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
set -e

# first arg is `-f` or `--some-option`
# or first arg is `something.conf`
if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then
set -- valkey-server "$@"
fi

# allow the container to be started with `--user`
if [ "$1" = 'valkey-server' -a "$(id -u)" = '0' ]; then
find . \! -user valkey -exec chown valkey '{}' +
exec setpriv --reuid=valkey --regid=valkey --init-groups --inh-caps=-all "$BASH_SOURCE" "$@"
fi

# set an appropriate umask (if one isn't set already)
# - https://github.com/docker-library/redis/issues/305
# - https://github.com/redis/redis/blob/bb875603fb7ff3f9d19aad906bd45d7db98d9a39/utils/systemd-redis_server.service#L37
um="$(umask)"
if [ "$um" = '0022' ]; then
umask 0077
fi

exec "$@"
1 change: 1 addition & 0 deletions .pipelines/containerSourceData/valkey/valkey.name
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
valkey
3 changes: 3 additions & 0 deletions .pipelines/containerSourceData/valkey/valkey.pkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
valkey
cronie
util-linux
Loading