File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ ENV HOME=${USER_HOME_DIR}
99ENV BUILDAH_ISOLATION=chroot
1010
1111COPY --chown=0:0 entrypoint.sh /
12+ COPY --chown=0:0 podman-wrapper.sh /usr/bin/
1213
1314RUN microdnf --disableplugin=subscription-manager install -y ${INSTALL_PACKAGES}; \
1415 microdnf update -y ; \
@@ -17,6 +18,7 @@ RUN microdnf --disableplugin=subscription-manager install -y ${INSTALL_PACKAGES}
1718 mkdir -p ${WORK_DIR} ; \
1819 pip3 install -U podman-compose ; \
1920 pip3 install -U cekit ; \
21+ mkdir -p /home/user/.local/share ; \
2022 chgrp -R 0 /home ; \
2123 chmod -R g=u /home ${WORK_DIR} ; \
2224 chmod +x /entrypoint.sh ; \
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ ORIGINAL_PODMAN_PATH=${ORIGINAL_PODMAN_PATH:- " /usr/bin/podman.orig" }
5+ KUBEDOCK_SUPPORTED_COMMANDS=${KUBEDOCK_SUPPORTED_COMMANDS:- " run ps exec cp logs inspect kill rm wait stop start" }
6+
7+ PODMAN_ARGS=( " $@ " )
8+
9+ TRUE=0
10+ FALSE=1
11+
12+ exec_original_podman () {
13+ exec ${ORIGINAL_PODMAN_PATH} " ${PODMAN_ARGS[@]} "
14+ }
15+
16+ exec_kubedock_podman () {
17+ exec env CONTAINER_HOST=tcp://127.0.0.1:2475 " ${ORIGINAL_PODMAN_PATH} " " ${PODMAN_ARGS[@]} "
18+ }
19+
20+ podman_command () {
21+ echo " ${PODMAN_ARGS[0]} "
22+ }
23+
24+ command_is_supported_by_kubedock () {
25+ CMD=$( podman_command)
26+ for SUPPORTED_CMD in $KUBEDOCK_SUPPORTED_COMMANDS ; do
27+ if [ " $SUPPORTED_CMD " = " $CMD " ]; then
28+ return $TRUE
29+ fi
30+ done
31+ return ${FALSE}
32+ }
33+
34+ if command_is_supported_by_kubedock; then
35+ exec_kubedock_podman
36+ else
37+ exec_original_podman
38+ fi
You can’t perform that action at this time.
0 commit comments