Skip to content

Commit 66c49c4

Browse files
committed
chore(redis): premission denied
1 parent f876d1f commit 66c49c4

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

charts/redis/templates/redis-statefulset.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ spec:
3232
memory: {{.Values.limitsMemory}}
3333
{{- end}}
3434
{{- end}}
35-
command: ["/bin/boot", "--port", "6379"]
35+
args:
36+
- "/bin/boot"
37+
- "--port"
38+
- "6379"
3639
ports:
3740
- containerPort: 6379
3841
volumeMounts:
@@ -42,6 +45,10 @@ spec:
4245
- name: redis-data
4346
mountPath: /data
4447
{{- end }}
48+
securityContext:
49+
fsGroup: 1001
50+
runAsGroup: 1001
51+
runAsUser: 1001
4552
volumes:
4653
- name: redis-creds
4754
secret:

rootfs/Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
FROM docker.io/drycc/base:bullseye
22

3-
RUN adduser --system \
4-
--shell /bin/bash \
5-
--disabled-password \
6-
--home /data \
7-
--group \
8-
redis
3+
ARG DRYCC_UID=1001
4+
ARG DRYCC_GID=1001
5+
ARG DRYCC_HOME_DIR=/data
6+
7+
RUN groupadd drycc --gid ${DRYCC_GID} \
8+
&& useradd drycc -u ${DRYCC_UID} -g ${DRYCC_GID} -s /bin/bash -m -d ${DRYCC_HOME_DIR}
99

1010
COPY bin/boot /bin/boot
1111
COPY etc/redis/redis.conf /etc/redis/redis.conf
@@ -26,8 +26,9 @@ RUN install-stack redis $REDIS_VERSION \
2626
/usr/lib/`echo $(uname -m)`-linux-gnu/gconv/IBM* \
2727
/usr/lib/`echo $(uname -m)`-linux-gnu/gconv/EBC* \
2828
&& bash -c "mkdir -p /usr/share/man/man{1..8}" \
29-
&& chown -R redis:redis /etc/redis /data
29+
&& chown -R drycc:drycc /etc/redis ${DRYCC_HOME_DIR}
3030

31-
USER redis
31+
USER drycc
32+
WORKDIR ${DRYCC_HOME_DIR}
3233
CMD ["/bin/boot"]
3334
EXPOSE 6379

0 commit comments

Comments
 (0)