I can't install plugins elasticsearch in docker

I'm trying to install a plugin for elasticsearch in a docker container. I run the command:

docker exec a15de2d3dc21 bin/elasticsearch-plugin install analysis-phonetic

and get an error:

-> Installing analysis-phonetic
-> Failed installing analysis-phonetic
-> Rolling back analysis-phonetic
-> Rolled back analysis-phonetic
Exception in thread "main" java.net.UnknownHostException: artifacts.elastic.co
        at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
        at java.base/java.net.Socket.connect(Socket.java:633)
        at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:299)
        at java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:174)
        at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
        at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:498)
        at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
        at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
        at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380)
        at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:189)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
        at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:175)
        at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:142)
        at org.elasticsearch.plugins.cli.InstallPluginAction.urlExists(InstallPluginAction.java:446)
        at org.elasticsearch.plugins.cli.InstallPluginAction.getElasticUrl(InstallPluginAction.java:400)
        at org.elasticsearch.plugins.cli.InstallPluginAction.download(InstallPluginAction.java:316)
        at org.elasticsearch.plugins.cli.InstallPluginAction.execute(InstallPluginAction.java:242)
        at org.elasticsearch.plugins.cli.InstallPluginCommand.execute(InstallPluginCommand.java:88)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
        at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:95)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
        at org.elasticsearch.cli.Command.main(Command.java:77)
        at org.elasticsearch.plugins.cli.PluginCli.main(PluginCli.java:36)

I am using this docker image
docker.elastic.co/elasticsearch/elasticsearch:7.17.2

and it worked a couple of days ago. Could you tell me the reason?

The problem was resolved by restarting the Docker service. Perhaps it will be useful to someone.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.