How to Copy file to stopped docker container

前端 未结 4 2114
孤独总比滥情好
孤独总比滥情好 2021-02-18 21:04

I am running elasticsearch from within a docker container.

While configuring elasticsearch for ssl and shield my elasticsearch.yml file got illegal entry i

4条回答
  •  感情败类
    2021-02-18 21:10

    Tabs are not allowed in YML file. You can edit it with any editor nano or vim or vi.

    Replacing or editing the elasticsearch.yml file wont leads to data loss.

    Docker images are delivered trimmed to bare minimum - so no editor is installed with the shipped container. That's why there's a need to install it manually.

    docker exec -it  bash
    

    and run:

    apt-get update
    apt-get install vim
    

    or use the following Dockerfile:

    FROM confluent/postgres-bw:0.1

    RUN ["apt-get", "update"]
    RUN ["apt-get", "install", "-y", "vim"]
    

    For more How to edit file after I shell to a docker container?

提交回复
热议问题