Docker Image - Copy configuration in

#1

In my circleci configuration I have this:

version: 2
jobs:
  build:
    docker:
      - image: circleci/php:7.1-fpm-node-browsers
      - image: docker.elastic.co/elasticsearch/elasticsearch:6.3.0
        environment:
          - discovery.type=single-node
          - http.host=0.0.0.0
          - transport.host=127.0.0.1
          - ES_JAVA_OPTS=-Xms750m -Xmx750m

How to copy my hunspell config folder into docker elasticsearch?

I know command, but it does not work

docker cp /elasticsearch/hunspell elasticsearch:/usr/share/elasticsearch/config

#2

I don’t think you can do that, since you are inside a container that does not have Docker on it by default. You’d be trying to do docker cp from inside a container to a sibling container, but you can’t do that in Docker (by default, anyway). You can only do this in the host, and you do not have access to that.

You have a few options:

  • Roll your own image that inherits from the specified one, and you can put your config in place with COPY
  • Pass the config to in a custom Elasticsearch command (assuming the binary supports switches for the things you want to change).
  • Drop the ES image and install ES manually in your build container
closed #3

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