diff --git a/.pipelines/containerSourceData/valkey/Dockerfile-Valkey b/.pipelines/containerSourceData/valkey/Dockerfile-Valkey new file mode 100644 index 00000000000..e9853d46850 --- /dev/null +++ b/.pipelines/containerSourceData/valkey/Dockerfile-Valkey @@ -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"] \ No newline at end of file diff --git a/.pipelines/containerSourceData/valkey/configuration-files/valkey-docker-entrypoint.sh b/.pipelines/containerSourceData/valkey/configuration-files/valkey-docker-entrypoint.sh new file mode 100755 index 00000000000..9be1dd0371f --- /dev/null +++ b/.pipelines/containerSourceData/valkey/configuration-files/valkey-docker-entrypoint.sh @@ -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 "$@" \ No newline at end of file diff --git a/.pipelines/containerSourceData/valkey/valkey.name b/.pipelines/containerSourceData/valkey/valkey.name new file mode 100644 index 00000000000..83f14fffee9 --- /dev/null +++ b/.pipelines/containerSourceData/valkey/valkey.name @@ -0,0 +1 @@ +valkey diff --git a/.pipelines/containerSourceData/valkey/valkey.pkg b/.pipelines/containerSourceData/valkey/valkey.pkg new file mode 100644 index 00000000000..3067cfc1626 --- /dev/null +++ b/.pipelines/containerSourceData/valkey/valkey.pkg @@ -0,0 +1,3 @@ +valkey +cronie +util-linux