Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make OPENSEARCH_DASHBOARDS_HOME args works correctly in dashboards dockerfile #4327

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
#
# --opensearch.startupTimeout=60

# Setup Home Directory
export OPENSEARCH_DASHBOARDS_HOME=/usr/share/opensearch-dashboards
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this depends on ARG OPENSEARCH_DASHBOARDS_HOME in Dockerfile. so I added this to ENV at Dockerfile


opensearch_dashboards_vars=(
console.enabled
console.proxyConfig
Expand Down Expand Up @@ -176,7 +173,7 @@ function setupSecurityDashboardsPlugin {
function runOpensearchDashboards {
longopts=()
for opensearch_dashboards_var in ${opensearch_dashboards_vars[*]}; do
# 'opensearch.hosts' -> 'OPENSEARCH_URL'
# 'opensearch.hosts' -> 'OPENSEARCH_HOSTS'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opensearch.hosts is converted to OPENSEARCH_HOSTS. OPENSEARCH_URL is not correct.

env_var=$(echo ${opensearch_dashboards_var^^} | tr . _)

# Indirectly lookup env var values via the name of the var.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
#
# --opensearch.startupTimeout=60

# Setup Home Directory
export OPENSEARCH_DASHBOARDS_HOME=/usr/share/opensearch-dashboards

opensearch_dashboards_vars=(
console.enabled
console.proxyConfig
Expand Down Expand Up @@ -188,7 +185,7 @@ function setupSecurityDashboardsPlugin {
function runOpensearchDashboards {
longopts=()
for opensearch_dashboards_var in ${opensearch_dashboards_vars[*]}; do
# 'opensearch.hosts' -> 'OPENSEARCH_URL'
# 'opensearch.hosts' -> 'OPENSEARCH_HOSTS'
env_var=$(echo ${opensearch_dashboards_var^^} | tr . _)

# Indirectly lookup env var values via the name of the var.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
#
# --opensearch.startupTimeout=60

# Setup Home Directory
export OPENSEARCH_DASHBOARDS_HOME=/usr/share/opensearch-dashboards

opensearch_dashboards_vars=(
console.enabled
console.proxyConfig
Expand Down Expand Up @@ -188,7 +185,7 @@ function setupSecurityDashboardsPlugin {
function runOpensearchDashboards {
longopts=()
for opensearch_dashboards_var in ${opensearch_dashboards_vars[*]}; do
# 'opensearch.hosts' -> 'OPENSEARCH_URL'
# 'opensearch.hosts' -> 'OPENSEARCH_HOSTS'
env_var=$(echo ${opensearch_dashboards_var^^} | tr . _)

# Indirectly lookup env var values via the name of the var.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ WORKDIR $OPENSEARCH_DASHBOARDS_HOME

# Set PATH
ENV PATH=$PATH:$OPENSEARCH_DASHBOARDS_HOME/bin
ENV OPENSEARCH_DASHBOARDS_HOME=$OPENSEARCH_DASHBOARDS_HOME

# Change user
USER $UID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ WORKDIR $OPENSEARCH_DASHBOARDS_HOME

# Set PATH
ENV PATH=$PATH:$OPENSEARCH_DASHBOARDS_HOME/bin
ENV OPENSEARCH_DASHBOARDS_HOME=$OPENSEARCH_DASHBOARDS_HOME

# Change user
USER $UID
Expand Down