File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 1
1
FROM library/python:3.12-slim
2
2
3
+ ARG PYNUOADMIN_VERSION=2.4.0
4
+
3
5
# Install runtime dependencies
4
6
RUN set -ex; \
5
7
apt-get update; \
@@ -20,7 +22,7 @@ RUN mkdir /opt/nuodb-operations \
20
22
&& chown 1000:0 /opt/nuodb-operations
21
23
22
24
# Copy tools code as nuodb user
23
- USER 1000:1000
25
+ USER 1000:0
24
26
25
27
# Copy sidecar scripts
26
28
COPY --chown=1000:0 config_watcher/requirements.txt /opt/config_watcher/requirements.txt
@@ -31,6 +33,16 @@ COPY --chown=1000:0 docker/entrypoint.sh /usr/local/bin/
31
33
# Install tools requirements
32
34
RUN pip3 install -r /opt/config_watcher/requirements.txt
33
35
36
+ # Install pynuoadmin
37
+ RUN pip3 install pynuoadmin==${PYNUOADMIN_VERSION}
38
+ RUN echo "export NUOCMD_PYTHONPATH=$(pip show pynuoadmin | sed -ne 's|Location: \( .*\) |\1 |p')" >> /home/nuodb/.profile
39
+
40
+ ENV NUOCMD_CLIENT_KEY /etc/nuodb/keys/nuocmd.pem
41
+ ENV NUOCMD_VERIFY_SERVER /etc/nuodb/keys/ca.cert
42
+
43
+ ENV LANG en_US.UTF-8
44
+ ENV HOME /home/nuodb
45
+
34
46
ENTRYPOINT ["entrypoint.sh" ]
35
47
36
48
CMD [ "config_watcher" ]
Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ case "${uid}:${gid}" in
38
38
;;
39
39
esac
40
40
41
+ # Configure shell
42
+ . /home/nuodb/.profile
43
+
41
44
# Support well-known commands
42
45
case " $1 " in
43
46
(config_watcher)
Original file line number Diff line number Diff line change @@ -32,11 +32,21 @@ cp /etc/passwd /etc/passwd.nuodb
32
32
setup_dir /usr/local/bin 0775
33
33
) > /dev/null
34
34
35
- setup_file /home/nuodb/.bashrc << "EOF "
35
+ setup_file /home/nuodb/.profile << "EOF "
36
36
# Enable nss_wrapper if /tmp/passwd and /tmp/group exist
37
37
if [ -f /tmp/passwd -a -f /tmp/group ]; then
38
38
export LD_PRELOAD=libnss_wrapper.so
39
39
export NSS_WRAPPER_PASSWD=/tmp/passwd
40
40
export NSS_WRAPPER_GROUP=/tmp/group
41
41
fi
42
+
43
+ # Add nuocmd to the PATH
44
+ export PATH=/home/nuodb/.local/bin:$PATH
45
+ EOF
46
+
47
+ setup_file /home/nuodb/.bashrc << "EOF "
48
+ [ -f /home/nuodb/.profile ] && . /home/nuodb/.profile
49
+
50
+ # Enable tab completion for nuocmd
51
+ . "/home/nuodb/.local/etc/nuocmd-complete"
42
52
EOF
You can’t perform that action at this time.
0 commit comments