Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions functions/helper_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ get_docker_effective_command_line_args() {
}

get_docker_configuration_file() {
DOCKER_USER_HOME="$(grep -m1 "^$(ps -eo user,cmd | grep docker | grep -v grep |\
awk '{ print $1 }')" /etc/passwd | awk -F':' '{ print $6 }')"
FILE="$(get_docker_effective_command_line_args '--config-file' | \
sed 's/.*=//g')"

Expand All @@ -114,6 +116,10 @@ get_docker_configuration_file() {
CONFIG_FILE='/etc/docker/daemon.json'
return
fi
if [ -f "${DOCKER_USER_HOME}/.config/docker/daemon.json" ]; then
CONFIG_FILE="${DOCKER_USER_HOME}/.config/docker/daemon.json"
return
fi
CONFIG_FILE='/dev/null'
}

Expand Down