Skip to content
This repository has been archived by the owner on Oct 3, 2018. It is now read-only.

How to change the solr configuration? #7

Closed
zhaozhiming opened this issue May 18, 2015 · 1 comment
Closed

How to change the solr configuration? #7

zhaozhiming opened this issue May 18, 2015 · 1 comment
Labels

Comments

@zhaozhiming
Copy link

hi,
I want to change the configuration of solr, but the image don't have vim, and can't use sudo to install software, how to change config?
Please help, thanks.

@makuk66
Copy link
Owner

makuk66 commented Jul 7, 2015

There are various options:

  • you can copy the file from the container to your host, edit there, and copy back. With e.g. docker cp c8476689cc67:/opt/solr-5.2.1/server/solr/solr.xml . then docker exec -i c8476689cc67 dd of=/opt/solr-5.2.1/server/solr/solr.xml < solr.xml. That last one is a bit ugly; see Moving a file from the host system to a container via docker cp moby/moby#5846 for a feature request to make that nicer.
  • you can copy the modified file to a volume (see https://docs.docker.com/userguide/dockervolumes/), and copy it into place on the container. That can get a little messy with ownership user ids.
  • you can docker exec into the container and edit the file with cat and copy/paste, or for some kinds of edits use sed -i
  • you can build a new image using this one as a base, and apply your desired config at build time. That's what I'd recommend rather than messing with a particular container contents.
  • you can build a new image using this one as a parent, and include vim or any other editor you want

Out of interest, what specific changes are you considering?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants