-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ubi to configure kubedock and podman (#179)
Add podman, buildah, skopeo, fuse and kubedock functionality from developer image to base image Signed-off-by: David Kwon <[email protected]>
- Loading branch information
Showing
7 changed files
with
126 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,5 @@ | ||
#!/bin/bash | ||
|
||
# Ensure $HOME exists when starting | ||
if [ ! -d "${HOME}" ]; then | ||
mkdir -p "${HOME}" | ||
fi | ||
|
||
# Add current (arbitrary) user to /etc/passwd and /etc/group | ||
if ! whoami &> /dev/null; then | ||
if [ -w /etc/passwd ]; then | ||
echo "${USER_NAME:-user}:x:$(id -u):0:${USER_NAME:-user} user:${HOME}:/bin/bash" >> /etc/passwd | ||
echo "${USER_NAME:-user}:x:$(id -u):" >> /etc/group | ||
fi | ||
fi | ||
source kubedock_setup | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
# Kubedock setup script meant to be run from the entrypoint script. | ||
|
||
if [ "${KUBEDOCK_ENABLED:-false}" = "true" ]; then | ||
echo | ||
echo "Kubedock is enabled (env variable KUBEDOCK_ENABLED is set to true)." | ||
|
||
SECONDS=0 | ||
KUBEDOCK_TIMEOUT=${KUBEDOCK_TIMEOUT:-10} | ||
until [ -f $KUBECONFIG ]; do | ||
if ((SECONDS > KUBEDOCK_TIMEOUT)); then | ||
break | ||
fi | ||
echo "Kubeconfig doesn't exist yet. Waiting..." | ||
sleep 1 | ||
done | ||
|
||
if [ -f $KUBECONFIG ]; then | ||
echo "Kubeconfig found." | ||
|
||
KUBEDOCK_PARAMS=${KUBEDOCK_PARAMS:-"--reverse-proxy --kubeconfig $KUBECONFIG"} | ||
|
||
echo "Starting kubedock with params \"${KUBEDOCK_PARAMS}\"..." | ||
|
||
kubedock server ${KUBEDOCK_PARAMS} >/tmp/kubedock.log 2>&1 & | ||
|
||
echo "Done." | ||
|
||
echo "Replacing podman with podman-wrapper..." | ||
|
||
ln -f -s /usr/bin/podman.wrapper /home/tooling/.local/bin/podman | ||
|
||
export TESTCONTAINERS_RYUK_DISABLED="true" | ||
export TESTCONTAINERS_CHECKS_DISABLE="true" | ||
|
||
echo "Done." | ||
echo | ||
else | ||
echo "Could not find Kubeconfig at $KUBECONFIG" | ||
echo "Giving up..." | ||
fi | ||
else | ||
echo | ||
echo "Kubedock is disabled. It can be enabled with the env variable \"KUBEDOCK_ENABLED=true\"" | ||
echo "set in the workspace Devfile or in a Kubernetes ConfigMap in the developer namespace." | ||
echo | ||
ln -f -s /usr/bin/podman.orig /home/tooling/.local/bin/podman | ||
fi |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters