Opensearch security plugins not available in base image 1.2.4

i am trying to build custom docker image and this is how my dockerfile looks like:

FROM opensearchproject/opensearch:1.2.4

RUN /usr/share/opensearch/bin/opensearch-plugin install --batch opensearch-security
RUN /usr/share/opensearch/bin/opensearch-plugin install --batch opensearch-alerting
RUN /usr/share/opensearch/bin/opensearch-plugin install --batch opensearch-anomaly-detection
RUN /usr/share/opensearch/bin/opensearch-plugin install --batch opensearch-reports-scheduler
RUN /usr/share/opensearch/bin/opensearch-plugin install --batch opensearch-observability
RUN /usr/share/opensearch/bin/opensearch-plugin install --batch opensearch-index-management
RUN /usr/share/opensearch/bin/opensearch-plugin install --batch opensearch-cross-cluster-replication

when i try to build the above dockerfile, it says


[ 2/13] RUN /usr/share/opensearch/bin/opensearch-plugin install --batch opensearch-security:
#5 1.851 β†’ Installing opensearch-security
#5 1.855 A tool for managing installed opensearch plugins
#5 1.855
#5 1.855 β†’ Failed installing opensearch-security
#5 1.855 β†’ Rolling back opensearch-security
#5 1.855 β†’ Rolled back opensearch-security
#5 1.871 Non-option arguments:
#5 1.871 command
#5 1.871
#5 1.871 Option Description
#5 1.871 ------ -----------
#5 1.871 -E Configure a setting
#5 1.871 -h, --help Show help
#5 1.871 -s, --silent Show minimal output
#5 1.871 -v, --verbose Show verbose output
#5 1.871 ERROR: Unknown plugin opensearch-security

it clearly says Unknown plugin opensearch-security, AFAIK, these plugins should be inbuilt in the image itself and we are good to install them using bin/opensearch-plugin install command right ?

this is not happening for repository -s3, repositoru-azure, these plugins are getting installed , but all opensearch-* plugins are throwing above errors!

Any help would be highly appreciated!

@vanamvijay23 But these are already installed in the image you are using, are they not?

and try to run curl command against the opensearch endpoint, using below:

curl --insecure -uadmin:admin -XGET "https://localhost:9200/_opendistro/_security/authinfo?pretty"

If you get the roles information back, this would mean the security plugin is already installed.

You can also exec into container and run below command to see list of installed plugins:

./bin/opensearch-plugin list

hey @Anthony , yes my assumption is same, all plugins are built into opensearch docker image and we just need to install them using

opensearch-plugin install <plugin-name> , i am running into the issues, when i try to build the custom docker image with opensearch security plugin installation as mentioned above!

RUN /usr/share/opensearch/bin/opensearch-plugin install --batch opensearch-security

it gives me this error:

#5 1.855 β†’ Failed installing opensearch-security
#5 1.855 β†’ Rolling back opensearch-security
#5 1.855 β†’ Rolled back opensearch-security
#5 1.871 Non-option arguments:
#5 1.871 command
#5 1.871
#5 1.871 Option Description
#5 1.871 ------ -----------
#5 1.871 -E Configure a setting
#5 1.871 -h, --help Show help
#5 1.871 -s, --silent Show minimal output
#5 1.871 -v, --verbose Show verbose output
#5 1.871 ERROR: Unknown plugin opensearch-security

@vanamvijay23 but they are already installed, i.e. you don’t need to install them (again)

okay, does repository-s3 and repository-azure plugins are also installed ?

@vanamvijay23
They should not be as far as I know.

What result do you get when you run ./bin/opensearch-plugin list?

All plugins expect those two

@vanamvijay23 does this answer your question?

The opensearch image already has all opensearch* plugins installed. The others need to installed on top of these.

yes, i have installed them! thanks, the issue is resolved now , good to close!

1 Like