1

On a server with no internet connectivity, usually am installing packages using a proxy (tiny proxy on port 8888) by just doing export

How can i possibly install the delete-by-query plugin inside a docker container ?

If i do --publish 8888:8888 and export port 8888 in both host+container, i do not succeed on having internet connectivity inside the container (on host i can establish internet connectivity)

Can you please advise on how-to circumvent this ? am using the official elasticsearch docker image.

/usr/share/elasticsearch/bin/plugin install delete-by-query
nskalis
  • 2,232
  • 8
  • 30
  • 49
  • The delete-by-query plugin has been removed in favor of a new Delete By Query API implementation in core. ES 7.8. – derek.z Aug 05 '20 at 01:23

1 Answers1

1

You can set environments (ENV) in Dockerfiles

ENV http_proxy tiny_proxy:8888
ENV https_proxy tiny_proxy:8888

So when build the image, the build process will download plugin or other patches (such as yum update) from Internet via proxy servers you defined in Dockerfile

BMW
  • 42,880
  • 12
  • 99
  • 116
  • also, can it be done without restarting the container ? – nskalis May 16 '16 at 00:58
  • Not get your question. Docker image is a read-only layer, you need get the plugin installed when build it. But you shouldn't think to install the plugin in container, which running from docker image. Container is the writable-layer running on the image. – BMW May 16 '16 at 01:00
  • and export is not Docker way to set environment. Using `ENV` – BMW May 16 '16 at 01:02
  • oh thanks. let me try to build a new image with the plugin in question. and will confirm. – nskalis May 16 '16 at 01:03
  • Take a look on this as well: http://stackoverflow.com/questions/22179301/how-do-you-run-apt-get-in-a-dockerfile-behind-a-proxy – BMW May 16 '16 at 01:05