Skip to content

Commit 17ea593

Browse files
committed
Update Dockerfile.rocky9
1 parent f6f53b9 commit 17ea593

File tree

3 files changed

+31
-29
lines changed

3 files changed

+31
-29
lines changed

devops/build/packaging/docker/Dockerfile.rocky9

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ RUN sudo dnf install -y --enablerepo=crb liburing-devel && \
4545
# --------------------------------------------------------------------
4646
FROM rockylinux/rockylinux:9.6
4747

48-
# Set locale environment
48+
# Set locale environment and timezone
49+
ENV TZ=UTC
4950
ENV LANG=en_US.UTF-8
5051
ENV LC_ALL=en_US.UTF-8
5152

@@ -57,59 +58,58 @@ ENV COORDINATOR_DATA_DIRECTORY=/data0/database/coordinator/gpseg-1
5758

5859
# Runtime dependencies (keep aligned with devops/sandbox/Dockerfile.*.rockylinux9 where possible)
5960
# Note: do NOT install libcurl here to avoid rocky9 libcurl-minimal conflicts.
60-
RUN dnf -y install \
61-
openssh-server openssh-clients \
62-
sudo shadow-utils \
63-
bash procps-ng \
64-
ca-certificates \
65-
python3 \
61+
RUN dnf -y install --setopt=install_weak_deps=False \
6662
apr \
63+
bash \
6764
bzip2-libs \
65+
ca-certificates \
66+
glibc-langpack-en \
67+
iproute \
68+
keyutils \
6869
krb5-libs \
6970
libevent \
7071
libicu \
72+
libstdc++ \
73+
liburing \
74+
libuv \
7175
libuuid \
7276
libxml2 \
7377
libyaml \
7478
libzstd \
7579
lz4 \
7680
ncurses \
81+
net-tools \
7782
openldap \
83+
openssh-clients \
84+
openssh-server \
7885
openssl \
7986
pam \
8087
pcre2 \
8188
perl \
89+
procps-ng \
8290
protobuf \
91+
python3 \
8392
readline \
84-
zlib \
85-
glibc-langpack-en \
86-
libuv \
87-
liburing \
88-
iproute \
89-
net-tools \
90-
which \
9193
rsync \
92-
keyutils \
93-
libstdc++ && \
94+
shadow-utils \
95+
sudo \
96+
which \
97+
zlib && \
9498
dnf clean all && rm -rf /var/cache/dnf
9599

96-
# Set locale and create gpadmin user
100+
# Set locale, create gpadmin user, and setup directories & SSH config
97101
RUN echo "LANG=en_US.UTF-8" > /etc/locale.conf && \
98102
/usr/sbin/groupadd -r gpadmin && \
99103
/usr/sbin/useradd -m -r -g gpadmin gpadmin && \
100104
printf "Defaults:gpadmin !requiretty\ngpadmin ALL=(ALL) NOPASSWD: ALL\n" > /etc/sudoers.d/90-gpadmin && \
101105
chmod 440 /etc/sudoers.d/90-gpadmin && \
102-
echo -e '\n# Add Cloudberry entries\nif [ -f /usr/local/cloudberry-db/cloudberry-env.sh ]; then\n source /usr/local/cloudberry-db/cloudberry-env.sh\nfi' >> /home/gpadmin/.bashrc
103-
104-
# Create required directories with proper permissions
105-
RUN mkdir -p /data0/database/coordinator /data0/database/primary /data0/database/mirror && \
106+
echo -e '\n# Add Cloudberry entries\nif [ -f /usr/local/cloudberry-db/cloudberry-env.sh ]; then\n source /usr/local/cloudberry-db/cloudberry-env.sh\nfi' >> /home/gpadmin/.bashrc && \
107+
mkdir -p /data0/database/coordinator /data0/database/primary /data0/database/mirror && \
106108
mkdir -p /home/gpadmin/.ssh && \
107109
mkdir -p /run/sshd && \
108110
chown -R gpadmin:gpadmin /data0 /home/gpadmin/.ssh && \
109-
chmod 700 /home/gpadmin/.ssh
110-
111-
# SSH client config (host keys are generated at runtime by the entrypoint)
112-
RUN echo -e "Host *\n StrictHostKeyChecking no\n UserKnownHostsFile ~/.ssh/known_hosts\n ServerAliveInterval 60" > /home/gpadmin/.ssh/config && \
111+
chmod 700 /home/gpadmin/.ssh && \
112+
echo -e "Host *\n StrictHostKeyChecking no\n UserKnownHostsFile ~/.ssh/known_hosts\n ServerAliveInterval 60" > /home/gpadmin/.ssh/config && \
113113
chown gpadmin:gpadmin /home/gpadmin/.ssh/config && \
114114
chmod 600 /home/gpadmin/.ssh/config
115115

devops/build/packaging/docker/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ docker logs cloudberry-db
7070

7171
## Notes
7272

73-
- `sshd` is started for internal cluster communication. Port 22 is not exposed by default.
74-
- For better performance, consider raising ulimits:
73+
- **Timezone:** The container defaults to `UTC` (`TZ=UTC`). To use a different timezone, pass the `TZ` environment variable during run (e.g., `-e TZ=Asia/Shanghai`).
74+
- **Graceful Shutdown:** The entrypoint natively traps `SIGTERM`, `SIGINT`, and `SIGQUIT` to perform a safe `gpstop -a -M fast`. Standard `docker stop <container>` is perfectly safe and ensures data consistency.
75+
- **Internal SSH:** `sshd` is started exclusively for internal cluster communication. Port 22 is not exposed by default.
76+
- **System Limits:** For maximum performance, consider explicitly raising container limits at runtime:
7577
`--ulimit nofile=524288:524288 --ulimit nproc=131072:131072`.
76-
- Tuning config files are reused from `devops/sandbox/configs/`:
78+
- **Tuning Configs:** Environment system configurations are powerfully reused from `devops/sandbox/configs/`:
7779
`/etc/security/limits.d/90-cbdb-limits.conf` and `/etc/sysctl.d/90-cbdb-sysctl.conf`.

devops/build/packaging/docker/cloudberry-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ stop_cluster() {
262262
gpstop -a -M fast >/dev/null 2>&1 || true
263263
}
264264

265-
trap stop_cluster SIGTERM SIGINT
265+
trap stop_cluster SIGTERM SIGINT SIGQUIT
266266

267267
log_dir="${COORDINATOR_DATA_DIRECTORY}/log"
268268
log "Following coordinator logs in: ${log_dir}"

0 commit comments

Comments
 (0)