mirror of
https://github.com/clearlinux/dockerfiles.git
synced 2026-08-04 18:58:09 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d7d7323c69 | |||
| 31b61ab310 | |||
| 52fb1c147e |
@@ -30,7 +30,7 @@ jobs:
|
|||||||
name: Release Matrix
|
name: Release Matrix
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
image: ['cgit', 'golang', 'haproxy', 'iperf', 'mariadb', 'memcached', 'nginx', 'node', 'numpy-mp', 'perl', 'php', 'php-fpm', 'postgres', 'python', 'rabbitmq', 'r-base', 'redis', 'ruby', 'tesseract-ocr']
|
image: ['cgit', 'golang', 'haproxy', 'iperf', 'mariadb', 'memcached', 'nginx', 'node', 'numpy-mp', 'perl', 'php', 'php-fpm', 'postgres', 'python', 'rabbitmq', 'r-base', 'ruby', 'tesseract-ocr', 'valkey']
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Code Checkout
|
- name: Code Checkout
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ jobs:
|
|||||||
- machine-learning-ui
|
- machine-learning-ui
|
||||||
- mariadb
|
- mariadb
|
||||||
- memcached
|
- memcached
|
||||||
- mixer-ci
|
|
||||||
- nginx
|
- nginx
|
||||||
- node
|
- node
|
||||||
- openjdk/8
|
- openjdk/8
|
||||||
@@ -30,8 +29,8 @@ jobs:
|
|||||||
- postgres
|
- postgres
|
||||||
- python
|
- python
|
||||||
- rabbitmq
|
- rabbitmq
|
||||||
- redis
|
|
||||||
- ruby
|
- ruby
|
||||||
|
- valkey
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: install
|
- name: install
|
||||||
@@ -44,6 +43,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
dir=$(pwd)
|
dir=$(pwd)
|
||||||
cd ${{matrix.node}}
|
cd ${{matrix.node}}
|
||||||
docker build -t clearlinux/${{matrix.node}} .
|
docker build -t ghcr.io/clearlinux/${{matrix.node}} .
|
||||||
cd $dir
|
cd $dir
|
||||||
if [ -d "./tests/${{matrix.node}}" ]; then cd tests; make ${{matrix.node}}; fi
|
if [ -d "./tests/${{matrix.node}}" ]; then cd tests; make ${{matrix.node}}; fi
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ It can leverage AVX512 advantage and set OMP_NUM_THREADS dynamically at runtime
|
|||||||
* Put the required python packages in the "requirements.txt".
|
* Put the required python packages in the "requirements.txt".
|
||||||
For example,
|
For example,
|
||||||
|
|
||||||
`echo "redis" >> numpy-openfaas/requirements.txt`
|
`echo "valkey" >> numpy-openfaas/requirements.txt`
|
||||||
`echo "flask" >> numpy-openfaas/requirements.txt`
|
`echo "flask" >> numpy-openfaas/requirements.txt`
|
||||||
|
|
||||||
* Put the required Clear Linux bundles in the "bundles.txt".
|
* Put the required Clear Linux bundles in the "bundles.txt".
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ This template is based on [clearlinux/python:3](https://hub.docker.com/r/clearli
|
|||||||
* Put the required python packages in the "requirements.txt".
|
* Put the required python packages in the "requirements.txt".
|
||||||
For example,
|
For example,
|
||||||
|
|
||||||
`echo "redis" >> hello-openfaas/requirements.txt`
|
`echo "valkey" >> hello-openfaas/requirements.txt`
|
||||||
`echo "flask" >> hello-openfaas/requirements.txt`
|
`echo "flask" >> hello-openfaas/requirements.txt`
|
||||||
|
|
||||||
* Put the required Clear Linux bundles in the "bundles.txt".
|
* Put the required Clear Linux bundles in the "bundles.txt".
|
||||||
|
|||||||
@@ -6,15 +6,17 @@ create_image() {
|
|||||||
local name="$1"
|
local name="$1"
|
||||||
local ver="$2"
|
local ver="$2"
|
||||||
pushd "${name}"
|
pushd "${name}"
|
||||||
echo "Creating ${name} for version ${ver}"
|
echo "Creating ${name} for version ${ver}"
|
||||||
docker build -t ghcr.io/clearlinux/"${name}":"${ver}" . --build-arg="clear_ver=${ver}"
|
docker build -t ghcr.io/clearlinux/"${name}":latest . --build-arg="clear_ver=${ver}"
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
push_image() {
|
push_image() {
|
||||||
local name="$1"
|
local name="$1"
|
||||||
local ver="$2"
|
local ver="$2"
|
||||||
echo "Pushing ${name} for version ${ver}"
|
echo "Pushing ${name} for version ${ver}"
|
||||||
|
docker tag ghcr.io/clearlinux/"${name}":latest ghcr.io/clearlinux/"${name}":"${ver}"
|
||||||
|
docker push ghcr.io/clearlinux/"${name}":latest
|
||||||
docker push ghcr.io/clearlinux/"${name}":"${ver}"
|
docker push ghcr.io/clearlinux/"${name}":"${ver}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+36
-7
@@ -1,15 +1,44 @@
|
|||||||
FROM clearlinux:latest
|
|
||||||
ARG clear_ver
|
ARG clear_ver
|
||||||
|
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
|
||||||
|
FROM clearlinux:latest AS builder
|
||||||
|
|
||||||
|
ARG clear_ver
|
||||||
|
ARG swupd_args
|
||||||
|
# Move to latest Clear Linux release to ensure
|
||||||
|
# that the swupd command line arguments are
|
||||||
|
# correct
|
||||||
|
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
|
||||||
|
|
||||||
|
# Grab os-release info from the minimal base image so
|
||||||
|
# that the new content matches the exact OS version
|
||||||
|
COPY --from=core /usr/lib/os-release /
|
||||||
|
|
||||||
|
# Install additional content in a target directory
|
||||||
|
# using the os version from the minimal base
|
||||||
|
RUN source /os-release && \
|
||||||
|
mkdir /install_root \
|
||||||
|
&& swupd os-install -V ${VERSION_ID} \
|
||||||
|
--path /install_root --statedir /swupd-state \
|
||||||
|
--bundles=mixer,go-basic,c-basic,os-core-update-dev,sudo --no-boot-update
|
||||||
|
|
||||||
|
# For some Host OS configuration with redirect_dir on,
|
||||||
|
# extra data are saved on the upper layer when the same
|
||||||
|
# file exists on different layers. To minimize docker
|
||||||
|
# image size, remove the overlapped files before copy.
|
||||||
|
RUN mkdir /os_core_install
|
||||||
|
COPY --from=core / /os_core_install/
|
||||||
|
RUN cd / && \
|
||||||
|
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
|
||||||
|
|
||||||
|
FROM core
|
||||||
|
|
||||||
|
COPY --from=builder /install_root /
|
||||||
|
|
||||||
|
RUN useradd -G wheelnopw clr && mkdir -p /run/lock
|
||||||
|
|
||||||
# Configure Go
|
|
||||||
ENV GOPATH /home/clr/go
|
ENV GOPATH /home/clr/go
|
||||||
ENV PATH="/home/clr/go/bin:${PATH}"
|
ENV PATH="/home/clr/go/bin:${PATH}"
|
||||||
|
|
||||||
# Update and add bundles
|
|
||||||
RUN swupd update -V $clear_ver && \
|
|
||||||
swupd bundle-add mixer go-basic c-basic os-core-update-dev sudo && \
|
|
||||||
useradd -G wheelnopw clr && \
|
|
||||||
mkdir -p /run/lock
|
|
||||||
USER clr
|
USER clr
|
||||||
RUN git config --global user.email "travis@example.com" && \
|
RUN git config --global user.email "travis@example.com" && \
|
||||||
git config --global user.name "Travis CI"
|
git config --global user.name "Travis CI"
|
||||||
|
|||||||
@@ -34,21 +34,21 @@ The test cases are for the Containers already added in the Actions CI.
|
|||||||
So for any Containers name defined in the matrix.node of .github/workflows/
|
So for any Containers name defined in the matrix.node of .github/workflows/
|
||||||
tests.yml, the same name directory could be added in the directory "tests".
|
tests.yml, the same name directory could be added in the directory "tests".
|
||||||
And the same name BAT script in the new added directory will be executed for
|
And the same name BAT script in the new added directory will be executed for
|
||||||
each PR/commits. For example, redis.
|
each PR/commits. For example, valkey.
|
||||||
* First, the redis name is added in the matrix.node.
|
* First, the valkey name is added in the matrix.node.
|
||||||
```
|
```
|
||||||
matrix:
|
matrix:
|
||||||
node: ["redis"]
|
node: ["valkey"]
|
||||||
```
|
```
|
||||||
|
|
||||||
* Second, create the "redis" directory and BAT script under tests
|
* Second, create the "valkey" directory and BAT script under tests
|
||||||
```
|
```
|
||||||
dockerfiles
|
dockerfiles
|
||||||
└── tests
|
└── tests
|
||||||
└── redis
|
└── valkey
|
||||||
└── redis.bats
|
└── valkey.bats
|
||||||
└── redis-security.bats
|
└── valkey-security.bats
|
||||||
```
|
```
|
||||||
|
|
||||||
* Last, develop the redis BAT test cases in "redis.bats" and "redis-security.bats" following the above
|
* Last, develop the valkey BAT test cases in "valkey.bats" and "valkey-security.bats" following the above
|
||||||
principles.
|
principles.
|
||||||
|
|||||||
+1
-1
@@ -7,6 +7,6 @@ The dockerfiles are from [page](https://github.com/clearlinux/dockerfiles). The
|
|||||||
|
|
||||||
To run the tests, you can simple type "make tests", it will run all the test cases.
|
To run the tests, you can simple type "make tests", it will run all the test cases.
|
||||||
If you want to run specific Container test, just type "make SERVICE-NAME".
|
If you want to run specific Container test, just type "make SERVICE-NAME".
|
||||||
For example, "make redis" to run tests for redis.
|
For example, "make valkey" to run tests for valkey.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
#!/usr/bin/env bats
|
|
||||||
# Copyright (C) 2018 Intel Corporation
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
load ../utils
|
|
||||||
load ../security
|
|
||||||
|
|
||||||
@test "1191 test" {
|
|
||||||
# start container first
|
|
||||||
docker run --name redis-server --detach clearlinux/redis
|
|
||||||
run check_container_status redis-server
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
run Test_1191 clearlinux/redis
|
|
||||||
[ "$output" == "pass" ]
|
|
||||||
|
|
||||||
# stop the container
|
|
||||||
docker rm -f redis-server
|
|
||||||
sleep 3
|
|
||||||
run check_container_status redis-server
|
|
||||||
[ "$status" -eq 1 ]
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "1195 test" {
|
|
||||||
# start container first
|
|
||||||
docker run --name redis-server --detach clearlinux/redis
|
|
||||||
run check_container_status redis-server
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
run Test_1195 clearlinux/redis
|
|
||||||
[ "$output" == "pass" ]
|
|
||||||
|
|
||||||
# stop the container
|
|
||||||
docker rm -f redis-server
|
|
||||||
sleep 3
|
|
||||||
run check_container_status redis-server
|
|
||||||
[ "$status" -eq 1 ]
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "1215 test" {
|
|
||||||
# start container first
|
|
||||||
docker run --name redis-server --detach --security-opt=no-new-privileges clearlinux/redis
|
|
||||||
run check_container_status redis-server
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
run Test_1215 clearlinux/redis
|
|
||||||
[ "$output" == "pass" ]
|
|
||||||
|
|
||||||
# stop the container
|
|
||||||
docker rm -f redis-server
|
|
||||||
sleep 3
|
|
||||||
run check_container_status redis-server
|
|
||||||
[ "$status" -eq 1 ]
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
#!/usr/bin/env bats
|
|
||||||
# Copyright (C) 2018 Intel Corporation
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
load ../utils
|
|
||||||
|
|
||||||
@test "Redis LPUSH test" {
|
|
||||||
# start tje container first
|
|
||||||
docker run --name redis-server --rm -d clearlinux/redis redis-server --protected-mode no
|
|
||||||
sleep 5
|
|
||||||
run check_container_status redis-server
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
|
|
||||||
# get ip address
|
|
||||||
run get_container_ip redis-server
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
ipaddr="$output"
|
|
||||||
|
|
||||||
# push two integers
|
|
||||||
docker run --rm clearlinux/redis redis-cli -h $ipaddr lpush mylist x
|
|
||||||
docker run --rm clearlinux/redis redis-cli -h $ipaddr lpush mylist y
|
|
||||||
|
|
||||||
# stop the container
|
|
||||||
docker stop redis-server
|
|
||||||
sleep 3
|
|
||||||
run check_container_status redis-server
|
|
||||||
[ "$status" -eq 1 ]
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "Redis LRANGE test" {
|
|
||||||
# start tje container first
|
|
||||||
docker run --name redis-server --rm -d clearlinux/redis redis-server --protected-mode no
|
|
||||||
sleep 5
|
|
||||||
run check_container_status redis-server
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
|
|
||||||
# get ip address
|
|
||||||
run get_container_ip redis-server
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
ipaddr="$output"
|
|
||||||
|
|
||||||
# push two integers
|
|
||||||
docker run --rm clearlinux/redis redis-cli -h $ipaddr lrange mylist 0 -1
|
|
||||||
|
|
||||||
# stop the container
|
|
||||||
docker stop redis-server
|
|
||||||
sleep 3
|
|
||||||
run check_container_status redis-server
|
|
||||||
[ "$status" -eq 1 ]
|
|
||||||
}
|
|
||||||
|
|
||||||
Executable
+53
@@ -0,0 +1,53 @@
|
|||||||
|
#!/usr/bin/env bats
|
||||||
|
# Copyright (C) 2018 Intel Corporation
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
load ../utils
|
||||||
|
load ../security
|
||||||
|
|
||||||
|
@test "1191 test" {
|
||||||
|
# start container first
|
||||||
|
docker run --name valkey-server --detach ghcr.io/clearlinux/valkey
|
||||||
|
run check_container_status valkey-server
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
run Test_1191 ghcr.io/clearlinux/valkey
|
||||||
|
[ "$output" == "pass" ]
|
||||||
|
|
||||||
|
# stop the container
|
||||||
|
docker rm -f valkey-server
|
||||||
|
sleep 3
|
||||||
|
run check_container_status valkey-server
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "1195 test" {
|
||||||
|
# start container first
|
||||||
|
docker run --name valkey-server --detach ghcr.io/clearlinux/valkey
|
||||||
|
run check_container_status valkey-server
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
run Test_1195 ghcr.io/clearlinux/valkey
|
||||||
|
[ "$output" == "pass" ]
|
||||||
|
|
||||||
|
# stop the container
|
||||||
|
docker rm -f valkey-server
|
||||||
|
sleep 3
|
||||||
|
run check_container_status valkey-server
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "1215 test" {
|
||||||
|
# start container first
|
||||||
|
docker run --name valkey-server --detach --security-opt=no-new-privileges ghcr.io/clearlinux/valkey
|
||||||
|
run check_container_status valkey-server
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
run Test_1215 ghcr.io/clearlinux/valkey
|
||||||
|
[ "$output" == "pass" ]
|
||||||
|
|
||||||
|
# stop the container
|
||||||
|
docker rm -f valkey-server
|
||||||
|
sleep 3
|
||||||
|
run check_container_status valkey-server
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Executable
+51
@@ -0,0 +1,51 @@
|
|||||||
|
#!/usr/bin/env bats
|
||||||
|
# Copyright (C) 2018 Intel Corporation
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
load ../utils
|
||||||
|
|
||||||
|
@test "valkey LPUSH test" {
|
||||||
|
# start the container first
|
||||||
|
docker run --name valkey-server --rm -d ghcr.io/clearlinux/valkey valkey-server --protected-mode no
|
||||||
|
sleep 5
|
||||||
|
run check_container_status valkey-server
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
|
||||||
|
# get ip address
|
||||||
|
run get_container_ip valkey-server
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
ipaddr="$output"
|
||||||
|
|
||||||
|
# push two integers
|
||||||
|
docker run --rm ghcr.io/clearlinux/valkey redis-cli -h $ipaddr lpush mylist x
|
||||||
|
docker run --rm ghcr.io/clearlinux/valkey redis-cli -h $ipaddr lpush mylist y
|
||||||
|
|
||||||
|
# stop the container
|
||||||
|
docker stop valkey-server
|
||||||
|
sleep 3
|
||||||
|
run check_container_status valkey-server
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "valkey LRANGE test" {
|
||||||
|
# start tje container first
|
||||||
|
docker run --name valkey-server --rm -d ghcr.io/clearlinux/valkey valkey-server --protected-mode no
|
||||||
|
sleep 5
|
||||||
|
run check_container_status valkey-server
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
|
||||||
|
# get ip address
|
||||||
|
run get_container_ip valkey-server
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
ipaddr="$output"
|
||||||
|
|
||||||
|
# push two integers
|
||||||
|
docker run --rm ghcr.io/clearlinux/valkey redis-cli -h $ipaddr lrange mylist 0 -1
|
||||||
|
|
||||||
|
# stop the container
|
||||||
|
docker stop valkey-server
|
||||||
|
sleep 3
|
||||||
|
run check_container_status valkey-server
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
}
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ RUN source /os-release && \
|
|||||||
mkdir /install_root \
|
mkdir /install_root \
|
||||||
&& swupd os-install -V ${VERSION_ID} \
|
&& swupd os-install -V ${VERSION_ID} \
|
||||||
--path /install_root --statedir /swupd-state \
|
--path /install_root --statedir /swupd-state \
|
||||||
--bundles=redis-native,findutils,su-exec --no-boot-update
|
--bundles=valkey,findutils,su-exec --no-boot-update
|
||||||
|
|
||||||
# For some Host OS configuration with redirect_dir on,
|
# For some Host OS configuration with redirect_dir on,
|
||||||
# extra data are saved on the upper layer when the same
|
# extra data are saved on the upper layer when the same
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
# Clear Linux* OS `redis` container image
|
# Clear Linux* OS `valkey` container image
|
||||||
|
|
||||||
<!-- Required -->
|
<!-- Required -->
|
||||||
## What is this image?
|
## What is this image?
|
||||||
|
|
||||||
`clearlinux/redis` is a Docker image with `redis` running on top of the
|
`clearlinux/valkey` is a Docker image with `valkey` running on top of the
|
||||||
[official clearlinux base image](https://hub.docker.com/_/clearlinux).
|
[official clearlinux base image](https://hub.docker.com/_/clearlinux).
|
||||||
|
|
||||||
<!-- application introduction -->
|
<!-- application introduction -->
|
||||||
> [Redis](https://redis.io/) is an open source (BSD licensed), in-memory data structure
|
> [Valkey](https://valkey.io/) is an open source (BSD licensed), in-memory data structure
|
||||||
> store, used as a database, cache and message broker. It supports data structures such
|
> store, used as a database, cache and message broker. It supports data structures such
|
||||||
> as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs,
|
> as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs,
|
||||||
> geospatial indexes with radius queries and streams.
|
> geospatial indexes with radius queries and streams.
|
||||||
@@ -40,23 +40,20 @@ To learn more about Clear Linux* OS, visit: https://clearlinux.org.
|
|||||||
The easiest way to get started with this image is by simply pulling it from
|
The easiest way to get started with this image is by simply pulling it from
|
||||||
Docker Hub.
|
Docker Hub.
|
||||||
|
|
||||||
*Note: This container uses the same syntax as the [official redis
|
|
||||||
image](https://hub.docker.com/_/redis).
|
|
||||||
|
|
||||||
|
1. Pull the image from Github Container Registry:
|
||||||
1. Pull the image from Docker Hub:
|
|
||||||
```
|
```
|
||||||
docker pull clearlinux/redis
|
docker pull ghcr.io/clearlinux/valkey
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Start a container using the examples below:
|
2. Start a container using the examples below:
|
||||||
```
|
```
|
||||||
docker run --name some-redis --network some-network -d clearlinux/redis redis-server --protected-mode no
|
docker run --name some-valkey --network some-network -d ghcr.io/clearlinux/valkey valkey-server --protected-mode no
|
||||||
```
|
```
|
||||||
|
|
||||||
3. connecting via redis-cli
|
3. connecting via redis-cli
|
||||||
```
|
```
|
||||||
docker run -it --network some-network --rm clearlinux/redis redis-cli -h some-redis
|
docker run -it --network some-network --rm ghcr.io/clearlinux/valkey redis-cli -h some-valkey
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- Optional -->
|
<!-- Optional -->
|
||||||
@@ -71,22 +68,22 @@ This image can also be deployed on a Kubernetes cluster, such as [minikube](http
|
|||||||
|
|
||||||
Steps to deploy redis on a Kubernetes cluster:
|
Steps to deploy redis on a Kubernetes cluster:
|
||||||
|
|
||||||
1. If you want to deploy `redis-deployment.yaml`
|
1. If you want to deploy `valkey-deployment.yaml`
|
||||||
|
|
||||||
```
|
```
|
||||||
kubectl create -f redis-deployment.yaml
|
kubectl create -f valkey-deployment.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
Or if you want to deploy `redis-deployment-conf.yaml`
|
Or if you want to deploy `valkey-deployment-conf.yaml`
|
||||||
|
|
||||||
```
|
```
|
||||||
kubectl create -f redis-deployment-conf.yaml
|
kubectl create -f valkey-deployment-conf.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Install redis bundle and connect to the service, where 30001 is the port number defined in your service.
|
2. Install valkey bundle and connect to the service, where 30001 is the port number defined in your service.
|
||||||
|
|
||||||
```
|
```
|
||||||
swupd bundle-add redis-native
|
swupd bundle-add valkey
|
||||||
redis-cli -h <nodeIP> -p 30001
|
redis-cli -h <nodeIP> -p 30001
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -104,17 +101,17 @@ modify the container images.
|
|||||||
|
|
||||||
2. Change to the directory of the application:
|
2. Change to the directory of the application:
|
||||||
```
|
```
|
||||||
cd redis/
|
cd valkey/
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Build the container image:
|
3. Build the container image:
|
||||||
```
|
```
|
||||||
docker build -t clearlinux/redis .
|
docker build -t ghcr.io/clearlinux/valkey .
|
||||||
```
|
```
|
||||||
|
|
||||||
Refer to the Docker documentation for [default build arguments](https://docs.docker.com/engine/reference/builder/#arg).
|
Refer to the Docker documentation for [default build arguments](https://docs.docker.com/engine/reference/builder/#arg).
|
||||||
Additionally:
|
Additionally:
|
||||||
|
|
||||||
- `swupd_args` - specifies arguments to pass to the Clear Linux* OS software
|
- `swupd_args` - specifies arguments to pass to the Clear Linux* OS software
|
||||||
manager. See the [swupd man pages](https://github.com/clearlinux/swupd-client/blob/master/docs/swupd.1.rst#options)
|
manager. See the [swupd man pages](https://github.com/clearlinux/swupd-client/blob/master/docs/swupd.1.rst#options)
|
||||||
for more information.
|
for more information.
|
||||||
@@ -4,11 +4,11 @@ set -e
|
|||||||
# first arg is `-f` or `--some-option`
|
# first arg is `-f` or `--some-option`
|
||||||
# or first arg is `something.conf`
|
# or first arg is `something.conf`
|
||||||
if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then
|
if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then
|
||||||
set -- redis-server "$@"
|
set -- valkey-server "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# change to redis user to run
|
# change to redis user to run
|
||||||
if [ "$1" = 'redis-server' -a "$(id -u)" = '0' ]; then
|
if [ "$1" = 'valkey-server' -a "$(id -u)" = '0' ]; then
|
||||||
exec su-exec redis "$BASH_SOURCE" "$@"
|
exec su-exec redis "$BASH_SOURCE" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -11,23 +11,23 @@ data:
|
|||||||
apiVersion: apps/v1beta1
|
apiVersion: apps/v1beta1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: redis-deployment
|
name: valkey-deployment
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
name: redis-deployment
|
name: valkey-deployment
|
||||||
labels:
|
labels:
|
||||||
app: redis
|
app: valkey
|
||||||
spec:
|
spec:
|
||||||
volumes:
|
volumes:
|
||||||
- name: config-volume
|
- name: config-volume
|
||||||
configMap:
|
configMap:
|
||||||
name: redis-config
|
name: valkey-config
|
||||||
containers:
|
containers:
|
||||||
- image: docker.io/clearlinux/redis
|
- image: ghcr.io/clearlinux/valkey
|
||||||
name: redis
|
name: valkey
|
||||||
command: ["redis-server"]
|
command: ["valkey-server"]
|
||||||
args: ["/etc/redis.conf","--protected-mode no"]
|
args: ["/etc/redis.conf","--protected-mode no"]
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: config-volume
|
- name: config-volume
|
||||||
@@ -38,7 +38,7 @@ spec:
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: redis-svc
|
name: valkey-svc
|
||||||
spec:
|
spec:
|
||||||
type: NodePort
|
type: NodePort
|
||||||
ports:
|
ports:
|
||||||
@@ -46,4 +46,4 @@ spec:
|
|||||||
targetPort: 6379
|
targetPort: 6379
|
||||||
nodePort: 30001
|
nodePort: 30001
|
||||||
selector:
|
selector:
|
||||||
app: redis
|
app: valkey
|
||||||
@@ -1,24 +1,24 @@
|
|||||||
apiVersion: apps/v1beta1
|
apiVersion: apps/v1beta1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: redis-deployment
|
name: valkey-deployment
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
name: redis-deployment
|
name: valkey-deployment
|
||||||
labels:
|
labels:
|
||||||
app: redis
|
app: valkey
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: docker.io/clearlinux/redis
|
- image: ghcr.io/clearlinux/valkey
|
||||||
name: redis
|
name: valkey
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: redis-svc
|
name: valkey-svc
|
||||||
spec:
|
spec:
|
||||||
type: NodePort
|
type: NodePort
|
||||||
ports:
|
ports:
|
||||||
@@ -26,5 +26,5 @@ spec:
|
|||||||
targetPort: 6379
|
targetPort: 6379
|
||||||
nodePort: 30001
|
nodePort: 30001
|
||||||
selector:
|
selector:
|
||||||
app: redis
|
app: valkey
|
||||||
|
|
||||||
Reference in New Issue
Block a user